Documentation ¶
Index ¶
- func Recover()
- type Agent
- type Conn
- type ConnSet
- type MsgParser
- func (p *MsgParser) Decode(c gnet.Conn) (data []byte, err error)
- func (p *MsgParser) Encode(c gnet.Conn, data []byte) ([]byte, error)
- func (p *MsgParser) Read(conn *TCPConn, buf []byte) ([]byte, error)
- func (p *MsgParser) SetByteOrder(littleEndian bool)
- func (p *MsgParser) SetLenMsgLenInMsg(lenMsgLenInMsg bool)
- func (p *MsgParser) SetMsgLen(lenMsgLen int, minMsgLen uint32, maxMsgLen uint32)
- func (p *MsgParser) Write(conn *TCPConn, in []byte) error
- type Processor
- type TCPClient
- type TCPConn
- func (tcpConn *TCPConn) Close() error
- func (tcpConn *TCPConn) Destroy()
- func (tcpConn *TCPConn) LocalAddr() net.Addr
- func (tcpConn *TCPConn) Read(b []byte) (int, error)
- func (tcpConn *TCPConn) ReadMsg(buf []byte) ([]byte, error)
- func (tcpConn *TCPConn) RemoteAddr() net.Addr
- func (tcpConn *TCPConn) Write(b []byte)
- func (tcpConn *TCPConn) WriteMsg(msg []byte) error
- type TCPServer
- func (server *TCPServer) OnClosed(c gnet.Conn, err error) (action gnet.Action)
- func (server *TCPServer) OnInitComplete(svr gnet.Server) gnet.Action
- func (server *TCPServer) OnOpened(c gnet.Conn) (out []byte, action gnet.Action)
- func (server *TCPServer) React(data []byte, c gnet.Conn) (action gnet.Action)
- func (server *TCPServer) Start()
- type WSClient
- type WSConn
- type WSServer
- func (server *WSServer) OnClosed(c gnet.Conn, err error) (action gnet.Action)
- func (server *WSServer) OnInitComplete(svr gnet.Server) gnet.Action
- func (server *WSServer) OnOpened(c gnet.Conn) (out []byte, action gnet.Action)
- func (server *WSServer) React(data []byte, c gnet.Conn) (action gnet.Action)
- func (server *WSServer) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MsgParser ¶
type MsgParser struct {
// contains filtered or unexported fields
}
-------------- | len | data | --------------
func NewMsgParser ¶
func NewMsgParser() *MsgParser
func (*MsgParser) SetByteOrder ¶
It's dangerous to call the method on reading or writing
func (*MsgParser) SetLenMsgLenInMsg ¶
type TCPClient ¶
type TCPClient struct { sync.Mutex Addr string ConnNum int ConnectInterval time.Duration PendingWriteNum int AutoReconnect bool NewAgent func(Conn) Agent // msg parser LenMsgLen int MinMsgLen uint32 MaxMsgLen uint32 LittleEndian bool LenMsgLenInMsg bool // if the msg len contain in "header" len Client_log bool ChanStop bool // contains filtered or unexported fields }
type TCPConn ¶
func (*TCPConn) RemoteAddr ¶
type TCPServer ¶
type TCPServer struct { Addr string MaxConnNum int NewAgent func(Conn) Agent // msg parser LenMsgLen int MinMsgLen uint32 MaxMsgLen uint32 LittleEndian bool LenMsgLenInMsg bool // if the msg len contain in "header" len ChanStop bool gnet.EventHandler Close func() // contains filtered or unexported fields }
func (*TCPServer) OnInitComplete ¶
type WSClient ¶
type WSServer ¶
type WSServer struct { Addr string MaxConnNum int MaxMsgLen uint32 CertFile string KeyFile string CaFile string HTTPTimeout time.Duration NewAgent func(Conn) Agent ConnNum int32 gnet.EventHandler Close func() // contains filtered or unexported fields }
func (*WSServer) OnInitComplete ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.