Documentation ¶
Index ¶
- Variables
- type Client
- type Config
- type Conn
- type IClient
- type IConn
- type IConnListener
- type IDataParser
- type IServer
- type KcpClient
- type TcpClient
- type UdpClient
- func (this *UdpClient) Close()
- func (this *UdpClient) Connect(addr string) error
- func (this *UdpClient) LocalAddr() string
- func (this *UdpClient) Read(p []byte) (n int, err error)
- func (this *UdpClient) RemoteAddr() string
- func (this *UdpClient) Send(buff []byte)
- func (this *UdpClient) SetDataParser(parser IDataParser)
- func (this *UdpClient) SetListener(listener IConnListener)
- type WsClient
Constants ¶
This section is empty.
Variables ¶
View Source
var MsgHeaderSize int = 2
View Source
var TcpClientRecvChanSize int = 4
View Source
var TcpClientSendChanSize int = 4
View Source
var TcpServerRecvChanSize int = 4
View Source
var TcpServerSendChanSize int = 4
View Source
var UdpClientRecvChanSize int = 4
View Source
var UdpClientSendChanSize int = 4
View Source
var UdpPacketSize int = 10240
View Source
var UdpServerRecvChanSize int = 1024
View Source
var UdpServerSendChanSize int = 1024
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Config ¶
type Config struct { SrvPeerId uint64 `json:"srvpeerid"` SrvPeerType byte `json:"srvpeertype"` UserEtype uint16 `json:"useretype"` UserEid uint64 `json:"usereid"` LocalPeerId uint64 `json:"localpeerid` LocalPeerType byte `json:"localpeertype"` Net string `json:"net"` SrvAddr string `json:"srvaddr"` }
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
func (*Conn) SetDataParser ¶
func (this *Conn) SetDataParser(parser IDataParser)
func (*Conn) SetListener ¶
func (this *Conn) SetListener(listener IConnListener)
type IConn ¶
type IConn interface { Send([]byte) Close() error LocalAddr() string RemoteAddr() string SetDataParser(IDataParser) SetListener(IConnListener) }
type IConnListener ¶
type IDataParser ¶
type KcpClient ¶
func NewKcpClient ¶
func NewKcpClient() *KcpClient
type TcpClient ¶
func NewTcpClient ¶
func NewTcpClient() *TcpClient
type UdpClient ¶
type UdpClient struct {
// contains filtered or unexported fields
}
func NewUdpClient ¶
func NewUdpClient() *UdpClient
func (*UdpClient) RemoteAddr ¶
func (*UdpClient) SetDataParser ¶
func (this *UdpClient) SetDataParser(parser IDataParser)
func (*UdpClient) SetListener ¶
func (this *UdpClient) SetListener(listener IConnListener)
Click to show internal directories.
Click to hide internal directories.