Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitHostPort ¶
SplitHostPort is the same as net.SplitHostPort, except that it allows hostport to be host without port.
Types ¶
type Address ¶
Address is a URI for a node
func NewAddress ¶
func NewAddress(protocol, host string, port uint16, supportedTransports []Transport) (*Address, error)
NewAddress creates an Address struct with given protocol and address
func (*Address) ConnRemoteAddr ¶
ConnRemoteAddr returns the remote address string that transport can dial
type KCPTransport ¶
type KCPTransport struct{}
KCPTransport is the transport layer based on KCP protocol
func NewKCPTransport ¶
func NewKCPTransport() *KCPTransport
NewKCPTransport creates a new KCP transport layer
func (*KCPTransport) GetNetwork ¶
func (t *KCPTransport) GetNetwork() string
GetNetwork returns the network used (tcp or udp)
func (*KCPTransport) Listen ¶
func (t *KCPTransport) Listen(port uint16) (net.Listener, error)
Listen listens for incoming packets to "port" on the network "udp"
func (*KCPTransport) String ¶
func (t *KCPTransport) String() string
type TCPTransport ¶
type TCPTransport struct{}
TCPTransport is the transport layer based on TCP protocol
func NewTCPTransport ¶
func NewTCPTransport() *TCPTransport
NewTCPTransport creates a new TCP transport layer
func (*TCPTransport) GetNetwork ¶
func (t *TCPTransport) GetNetwork() string
GetNetwork returns the network used (tcp or udp)
func (*TCPTransport) Listen ¶
func (t *TCPTransport) Listen(port uint16) (net.Listener, error)
Listen listens for incoming packets to "port" on the network "tcp"
func (*TCPTransport) String ¶
func (t *TCPTransport) String() string