Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTimeout is returned when an expected incoming connection was not received in time. ErrTimeout = errors.New("accept timeout") // ErrClosed means that the server was shut down before a response could be received. ErrClosed = errors.New("server closed") // ErrInvalidHandshake is returned when no correct handshake could be established. ErrInvalidHandshake = errors.New("invalid handshake") // ErrNoGossip means that the given peer does not support the gossip service. ErrNoGossip = errors.New("peer does not have a gossip service") )
Functions ¶
This section is empty.
Types ¶
type TCP ¶
type TCP struct {
// contains filtered or unexported fields
}
TCP establishes verified incoming and outgoing TCP connections to other peers.
func ServeTCP ¶
func ServeTCP(local *peer.Local, listener *net.TCPListener, log *zap.SugaredLogger) *TCP
ServeTCP creates the object and starts listening for incoming connections.
func (*TCP) AcceptPeer ¶
AcceptPeer awaits an incoming connection from the given peer. If the peer does not establish the connection or the handshake fails, an error is returned.
Click to show internal directories.
Click to hide internal directories.