Version: v1.0.3 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2017 License: Apache-2.0 Imports: 13 Imported by: 0




This section is empty.


This section is empty.


func FatalIfUnexpected

func FatalIfUnexpected(err error)

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

func IsClosedConnection

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

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

type Server struct {

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

func MakeServer

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

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

ServeWith accepts connections on ln and serves them using serveConn.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL