Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientI ¶
type ClientI interface { Start() Stop() Conn() ConnectionI GetMsgHandle() MsgHandleI AddRouter(uint32, RouterI) }
type ConnectionFunc ¶
type ConnectionFunc func(i ConnectionI)
type ConnectionI ¶
type ConnectionI interface { //启动连接 Start() //停止连接 Stop() //获取套接字 GetTcpConnection() *net.TCPConn //获取连接ID GetConnID() uint64 //获取远程客户端的地址 GetRemoteAddr() net.Addr GetManager() ManagerI //发送数据 Send(messageId uint32, data []byte) error SendBuff(messageId uint32, data []byte) error //设置链接属性 SetProperty(key string, value interface{}) //获取链接属性 GetProperty(key string) (interface{}, error) //移除链接属性 RemoveProperty(key string) }
type MsgHandleI ¶
type RequestI ¶
type RequestI interface { //获取连接 GetConnection() ConnectionI //获取数据 GetData() []byte GetMessageID() uint32 }
type ServerI ¶
type ServerI interface { Start() Stop() Serve() AddRouter(msgId uint32, routerInterface2 RouterI) GetManager() ManagerI CallAfterConnect(ConnectionI) CallBeforeConnect(ConnectionI) CallBeforeStop(ConnectionI) SetAfterConnect(ConnectionFunc) SetBeforeConnect(ConnectionFunc) SetBeforeStop(ConnectionFunc) }
Click to show internal directories.
Click to hide internal directories.