cockroach: Index | Files

package netutil

import ""


Package Files


func FatalIfUnexpected Uses

func FatalIfUnexpected(err error)

FatalIfUnexpected calls Log.Fatal(err) unless err is nil, cmux.ErrListenerClosed, or the net package's errClosed.

func IsClosedConnection Uses

func IsClosedConnection(err error) bool

IsClosedConnection returns true if err is cmux.ErrListenerClosed, grpc.ErrServerStopped, io.EOF, or the net package's errClosed.

func ListenAndServeGRPC Uses

func ListenAndServeGRPC(stopper *stop.Stopper, server *grpc.Server,
    addr net.Addr) (net.Listener, error)

ListenAndServeGRPC creates a listener and serves the specified grpc Server on it, closing the listener when signalled by the stopper.

type Server Uses

type Server struct {

Server is a thin wrapper around http.Server. See MakeServer for more detail.

func MakeServer Uses

func MakeServer(stopper *stop.Stopper, tlsConfig *tls.Config, handler http.Handler) Server

MakeServer constructs a Server that tracks active connections, closing them when signalled by stopper.

func (*Server) ServeWith Uses

func (s *Server) ServeWith(stopper *stop.Stopper, l net.Listener, serveConn func(net.Conn)) error

ServeWith accepts connections on ln and serves them using serveConn.

Package netutil imports 12 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).