Documentation ¶
Index ¶
- Variables
- func DialTCP(config interface{}, fc conn.FRecvChan) (conn.Connection, error)
- func DialUDP(config interface{}, fc conn.FRecvChan) (conn.Connection, error)
- func NewTCPListener(oc interface{}) (conn.Listener, error)
- func NewUDPListener(oc interface{}) (conn.Listener, error)
- type TCPConfig
- type TCPConnection
- func (c *TCPConnection) BindOwner(o conn.ConnectionOwner)
- func (c *TCPConnection) Close()
- func (c *TCPConnection) ConfoundCode() []byte
- func (c *TCPConnection) Done() <-chan struct{}
- func (c *TCPConnection) Owner() conn.ConnectionOwner
- func (c *TCPConnection) RecvChan() <-chan *protocol.Packet
- func (c *TCPConnection) Remote() net.Addr
- func (c *TCPConnection) Send(pac *protocol.Packet) error
- func (c *TCPConnection) SetConfoundCode(code []byte)
- func (c *TCPConnection) Start(s *conn.Sender) error
- type TCPListener
- type UDPConfig
- type UDPConnection
- func (c *UDPConnection) BindOwner(o conn.ConnectionOwner)
- func (c *UDPConnection) Close()
- func (c *UDPConnection) ConfoundCode() []byte
- func (c *UDPConnection) Done() <-chan struct{}
- func (c *UDPConnection) Owner() conn.ConnectionOwner
- func (c *UDPConnection) RecvChan() <-chan *protocol.Packet
- func (c *UDPConnection) Remote() net.Addr
- func (c *UDPConnection) Send(pac *protocol.Packet) error
- func (c *UDPConnection) SetConfoundCode(code []byte)
- func (c *UDPConnection) Start(s *conn.Sender) error
- type UDPListener
Constants ¶
This section is empty.
Variables ¶
View Source
var HeaderMinLength = 0
View Source
var UDPHeaderMinLength = 0
Functions ¶
func DialTCP ¶
func DialTCP(config interface{}, fc conn.FRecvChan) (conn.Connection, error)
参数config应为*TCPConfig
func NewTCPListener ¶
func NewUDPListener ¶
Types ¶
type TCPConfig ¶
type TCPConfig struct { ListenAddress string `json:"listenAddress,omitempty"` BufferLength int `json:"bufferLength,omitempty"` WriteTimeoutMS int `json:"writeTimeoutMS,omitempty"` DialTimeoutMS int `json:"dialTimeoutMS,omitempty"` }
func DefaultTCPConfig ¶
func DefaultTCPConfig() *TCPConfig
type TCPConnection ¶
type TCPConnection struct {
// contains filtered or unexported fields
}
func (*TCPConnection) BindOwner ¶
func (c *TCPConnection) BindOwner(o conn.ConnectionOwner)
func (*TCPConnection) Close ¶
func (c *TCPConnection) Close()
func (*TCPConnection) ConfoundCode ¶
func (c *TCPConnection) ConfoundCode() []byte
func (*TCPConnection) Done ¶
func (c *TCPConnection) Done() <-chan struct{}
func (*TCPConnection) Owner ¶
func (c *TCPConnection) Owner() conn.ConnectionOwner
func (*TCPConnection) RecvChan ¶
func (c *TCPConnection) RecvChan() <-chan *protocol.Packet
func (*TCPConnection) Remote ¶
func (c *TCPConnection) Remote() net.Addr
func (*TCPConnection) SetConfoundCode ¶
func (c *TCPConnection) SetConfoundCode(code []byte)
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func (*TCPListener) Accept ¶
func (lis *TCPListener) Accept(fc conn.FRecvChan) (conn.Connection, error)
func (*TCPListener) Addr ¶
func (lis *TCPListener) Addr() net.Addr
func (*TCPListener) Close ¶
func (lis *TCPListener) Close()
type UDPConfig ¶
type UDPConfig struct { ListenAddress string `json:"listenAddress,omitempty"` ReceiveGoNum int `json:"receiveGoNum,omitempty"` DialTimeoutMS int `json:"dialTimeoutMS,omitempty"` ActiveTimeoutMS int `json:"activeTimeoutMS,omitempty"` MTUBufferLength int `json:"mtuBufferLength,omitempty"` SignCode string `json:"signCode,omitempty"` }
func DefaultUDPConfig ¶
func DefaultUDPConfig() *UDPConfig
type UDPConnection ¶
type UDPConnection struct {
// contains filtered or unexported fields
}
func (*UDPConnection) BindOwner ¶
func (c *UDPConnection) BindOwner(o conn.ConnectionOwner)
func (*UDPConnection) Close ¶
func (c *UDPConnection) Close()
func (*UDPConnection) ConfoundCode ¶
func (c *UDPConnection) ConfoundCode() []byte
func (*UDPConnection) Done ¶
func (c *UDPConnection) Done() <-chan struct{}
func (*UDPConnection) Owner ¶
func (c *UDPConnection) Owner() conn.ConnectionOwner
func (*UDPConnection) RecvChan ¶
func (c *UDPConnection) RecvChan() <-chan *protocol.Packet
func (*UDPConnection) Remote ¶
func (c *UDPConnection) Remote() net.Addr
func (*UDPConnection) SetConfoundCode ¶
func (c *UDPConnection) SetConfoundCode(code []byte)
type UDPListener ¶
type UDPListener struct {
// contains filtered or unexported fields
}
func (*UDPListener) Accept ¶
func (lis *UDPListener) Accept(fc conn.FRecvChan) (conn.Connection, error)
func (*UDPListener) Addr ¶
func (lis *UDPListener) Addr() net.Addr
func (*UDPListener) Close ¶
func (lis *UDPListener) Close()
Click to show internal directories.
Click to hide internal directories.