Documentation ¶
Index ¶
- Variables
- type IClient
- type IConn
- type IConnListener
- type IDataParser
- type IServer
- type KcpServer
- type Server
- type ServerEx
- type TcpServer
- type UdpConn
- func (this *UdpConn) Close() error
- func (this *UdpConn) LocalAddr() net.Addr
- func (this *UdpConn) Read(p []byte) (n int, err error)
- func (this *UdpConn) RemoteAddr() net.Addr
- func (this *UdpConn) Send(buff []byte)
- func (this *UdpConn) SetDataParser(parser IDataParser)
- func (this *UdpConn) SetDeadline(t time.Time) error
- func (this *UdpConn) SetListener(listener IConnListener)
- func (this *UdpConn) SetReadDeadline(t time.Time) error
- func (this *UdpConn) SetWriteDeadline(t time.Time) error
- func (this *UdpConn) Write(b []byte) (n int, err error)
- type UdpServer
- type UdpServerEx
- func (this *UdpServerEx) OnError(errcode int, msg string)
- func (this *UdpServerEx) OnPostSend(buff []byte, raddr *net.UDPAddr, num int)
- func (this *UdpServerEx) OnPreSend(buff []byte, raddr *net.UDPAddr)
- func (this *UdpServerEx) OnRecv(buff []byte, raddr *net.UDPAddr)
- func (this *UdpServerEx) OnRecvBusy(buff []byte, raddr *net.UDPAddr)
- func (this *UdpServerEx) OnSendBusy(buff []byte, raddr *net.UDPAddr)
- func (this *UdpServerEx) OnStop()
- func (this *UdpServerEx) Start(addr string, connhandler func(net.Conn)) error
- type WsServer
Constants ¶
This section is empty.
Variables ¶
View Source
var KeepAlivePeriod time.Duration = 3000
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 IConn ¶
type IConn interface { Send([]byte) Close() error LocalAddr() string RemoteAddr() string SetDataParser(IDataParser) SetListener(IConnListener) }
type IConnListener ¶
type IDataParser ¶
type KcpServer ¶
type KcpServer struct {
// contains filtered or unexported fields
}
func NewKcpServer ¶
func NewKcpServer() *KcpServer
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type ServerEx ¶
type ServerEx struct {
// contains filtered or unexported fields
}
func NewServerEx ¶
func NewServerEx() *ServerEx
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
func NewTcpServer ¶
func NewTcpServer() *TcpServer
type UdpConn ¶
type UdpConn struct {
// contains filtered or unexported fields
}
func (*UdpConn) RemoteAddr ¶
func (*UdpConn) SetDataParser ¶
func (this *UdpConn) SetDataParser(parser IDataParser)
func (*UdpConn) SetListener ¶
func (this *UdpConn) SetListener(listener IConnListener)
type UdpServer ¶
type UdpServer struct { Listener udpServerListener Addr string // contains filtered or unexported fields }
func NewUdpServer ¶
type UdpServerEx ¶
type UdpServerEx struct { *UdpServer // contains filtered or unexported fields }
func NewUdpServerEx ¶
func NewUdpServerEx() *UdpServerEx
func (*UdpServerEx) OnError ¶
func (this *UdpServerEx) OnError(errcode int, msg string)
func (*UdpServerEx) OnPostSend ¶
func (this *UdpServerEx) OnPostSend(buff []byte, raddr *net.UDPAddr, num int)
func (*UdpServerEx) OnRecvBusy ¶
func (this *UdpServerEx) OnRecvBusy(buff []byte, raddr *net.UDPAddr)
func (*UdpServerEx) OnSendBusy ¶
func (this *UdpServerEx) OnSendBusy(buff []byte, raddr *net.UDPAddr)
func (*UdpServerEx) OnStop ¶
func (this *UdpServerEx) OnStop()
Click to show internal directories.
Click to hide internal directories.