Versions in this module Expand all Collapse all v1 v1.0.1 Apr 12, 2024 Changes in this version + type DataPack struct + Datas []byte + Head interface{} + type DefaultHeadHandler struct + func (d *DefaultHeadHandler) GetSize() uint32 + func (d *DefaultHeadHandler) ReadHead(bits []byte, head *HeadInfo) bool + func (d *DefaultHeadHandler) WriteHead(bits []byte, head *HeadInfo) bool + type FastLocker struct + func (l *FastLocker) Lock() + func (l *FastLocker) Unlock() + type HeadInfo struct + BodyLen uint32 + Head interface{} + SockId int32 + type IMsgHandler interface + OnConnect func(sock SocketConnection) + OnDisconnect func(sock SocketConnection) + OnMessage func(sock SocketConnection, msg *DataPack) + type IPackHeader interface + GetSize func() uint32 + ReadHead func(bits []byte, Head *HeadInfo) bool + WriteHead func(bits []byte, Head *HeadInfo) bool + type MsgBody struct + Datas []byte + MsgHead interface{} + type MsgHeader struct + type SockOptions struct + HeadHandler IPackHeader + MsgHandler IMsgHandler + SockBufferSize uint32 + type SocketClient interface + Close func() + Connected func() bool + GetConnection func() SocketConnection + Open func() + func NewSocketClient(addr string, avOpts SockOptions) SocketClient + type SocketConnection interface + Disconnect func() + GetData func() interface{} + GetId func() int32 + RemoteAddr func() net.Addr + SendMsg func(packHead interface{}, avBytes []byte) bool + SetData func(usrData interface{}) + type SocketServer interface + Close func() + Foreach func(f enum_callback) + GetConnectCount func() int32 + Open func(avPort uint16) bool + SendData func(SockId int32, Data []byte) bool + SendMsg func(SockId int32, msgHead interface{}, avBytes []byte) bool + func NewSocketServer(avOpts SockOptions) SocketServer