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 transport was shut down before a response could be received. ErrClosed = errors.New("transport 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 Connection ¶
Connection represents a network connection to a neighbor peer.
func (*Connection) Peer ¶
func (c *Connection) Peer() *peer.Peer
Peer returns the peer associated with that connection.
type TCP ¶
type TCP struct {
// contains filtered or unexported fields
}
TCP establishes verified incoming and outgoing TCP connections to other peers.
func (*TCP) AcceptPeer ¶
func (t *TCP) AcceptPeer(p *peer.Peer) (*Connection, error)
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.