Documentation ¶
Overview ¶
Conn is a wrapper of the origin network connection. It resolves the handshake information from the first version message including magic number, PID, network address etc.
Hub is a network hub to provide different services through one network address.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
Types ¶
type Conn ¶
type Conn struct { net.Conn // The origin network connection. // contains filtered or unexported fields }
Conn is a wrapper of the origin network connection.
func WrapConn ¶
WrapConn warps the origin network connection and returns a hub connection with the handshake information resolved from version message.
func (*Conn) NetAddr ¶
NetAddr returns the network address resolve from the origin connection and the version message.
func (*Conn) PID ¶
PID returns the PID resolved from the version message. It represents who is connecting.