FatalIfUnexpected calls Log.Fatal(err) unless err is nil, cmux.ErrListenerClosed, or the net package's errClosed.
IsClosedConnection returns true if err is cmux.ErrListenerClosed, grpc.ErrServerStopped, io.EOF, or the net package's errClosed.
ListenAndServeGRPC creates a listener and serves the specified grpc Server on it, closing the listener when signaled by the stopper.
SplitHostPort is like net.SplitHostPort however it supports addresses without a port number. In that case, the provided port number is used.
InitialHeartbeatFailedError indicates that while attempting a GRPC connection to a node, we aren't successful and have never seen a heartbeat over that connection before.
NewInitialHeartBeatFailedError creates a new InitialHeartbeatFailedError.
Error implements error.
Format implements fmt.Formatter.
FormatError implements errors.FormatError.
Server is a thin wrapper around http.Server. See MakeServer for more detail.
MakeServer constructs a Server that tracks active connections, closing them when signaled by stopper.
It can serve two different purposes simultaneously:
- to serve as actual HTTP server, using the .Serve(net.Listener) method. - to serve as plain TCP server, using the .ServeWith(...) method.
The latter is used e.g. to accept SQL client connections.
When the HTTP facility is not used, the Go HTTP server object is still used internally to maintain/register the connections via the ConnState() method, for convenience.
ServeWith accepts connections on ln and serves them using serveConn.