Versions in this module Expand all Collapse all v1 v1.0.2 Mar 9, 2022 Changes in this version + const WM_TCPCLIENT_CONNECTED + const WM_TCPCLIENT_DISCONNECTED + const WM_TCPCLIENT_RCV_DATA + const WM_TCPSERVER_CLIENT_CONNECTED + const WM_TCPSERVER_CLIENT_DISCONNECTED + const WM_TCPSERVER_CLIENT_RCV_DATA + const WM_TCPSERVER_STARTED + const WM_TCPSERVER_STOPPED + const WM_THREAD_EXIT + const WM_THREAD_START + const WM_TIMER + const WM_UDP_RCV_DATA + const WM_UDP_STARTED + const WM_UDP_STOPPED + type BSocketConnInfo struct + ConnClassId uint32 + ConnId uint32 + ConnServerId uint32 + ConnType string + EventTime time.Time + IsStart bool + LocalIp string + LocalPort int + RemoteIp string + RemotePort int + func (t *BSocketConnInfo) String() string + type BTcpClient struct + func NewBTcpClient(classid uint32) (*BTcpClient, error) + func (t *BTcpClient) FreeBs(bs []byte) error + func (t *BTcpClient) GetId() uint32 + func (t *BTcpClient) GetLocalAddr() (string, int) + func (t *BTcpClient) GetPacketSize() int + func (t *BTcpClient) GetRemoteAddr() (string, int) + func (t *BTcpClient) GetStatus() (bool, time.Time) + func (t *BTcpClient) SendData(bs []byte) (int, error) + func (t *BTcpClient) SetFnTcpClientConn(fnconn FnTcpClientConn) error + func (t *BTcpClient) SetFnTcpClientDisConn(fndisconn FnTcpClientDisConn) error + func (t *BTcpClient) SetFnTcpClientRcvData(fnrecv FnTcpClientRcvData) error + func (t *BTcpClient) SetId(classid uint32) error + func (t *BTcpClient) SetLocalAddr(localip string, localport int) error + func (t *BTcpClient) SetNotifyThread(notifythread IBaseThread) error + func (t *BTcpClient) SetPacketSize(packetsize int) error + func (t *BTcpClient) SetRemoteAddr(remoteip string, remoteport int) error + func (t *BTcpClient) Start() error + func (t *BTcpClient) Stop() error + type BTcpServer struct + func NewBTcpServer(classid uint32) *BTcpServer + func (t *BTcpServer) CloseAllClient() error + func (t *BTcpServer) CloseClient(clientid uint32) error + func (t *BTcpServer) FreeBs(bs []byte) error + func (t *BTcpServer) GetAllClient() *list.TList + func (t *BTcpServer) GetId() uint32 + func (t *BTcpServer) GetLocalAddr() (string, int) + func (t *BTcpServer) GetPacketSize() int + func (t *BTcpServer) GetStatus() (bool, time.Time) + func (t *BTcpServer) SendData(clientid uint32, bs []byte) (int, error) + func (t *BTcpServer) SetFnTcpServerConn(fnconn FnTcpServerConn) error + func (t *BTcpServer) SetFnTcpServerDisConn(fndisconn FnTcpServerDisConn) error + func (t *BTcpServer) SetFnTcpServerRcvData(fnrecv FnTcpServerRcvData) error + func (t *BTcpServer) SetFnTcpServerStart(fnstart FnTcpServerStart) error + func (t *BTcpServer) SetFnUdpStop(fnstop FnTcpServerStop) error + func (t *BTcpServer) SetId(classid uint32) error + func (t *BTcpServer) SetLocalAddr(localip string, localport int) error + func (t *BTcpServer) SetNotifyThread(notifythread IBaseThread) error + func (t *BTcpServer) SetPacketSize(packetsize int) error + func (t *BTcpServer) Start() error + func (t *BTcpServer) Stop() error + type BUdp struct + func NewBUdp(classid uint32) (*BUdp, error) + func (t *BUdp) FreeBs(bs []byte) error + func (t *BUdp) GetId() uint32 + func (t *BUdp) GetLocalAddr() (string, int) + func (t *BUdp) GetPacketSize() int + func (t *BUdp) GetRemoteAddr() (string, int) + func (t *BUdp) GetStatus() (bool, time.Time) + func (t *BUdp) SendData(bs []byte) (int, error) + func (t *BUdp) SendDataTo(remoteip string, remoteport int, bs []byte) (int, error) + func (t *BUdp) SetFnUdpRcvData(fnrecv FnUdpRcvData) error + func (t *BUdp) SetFnUdpStart(fnstart FnUdpStart) error + func (t *BUdp) SetFnUdpStop(fnstop FnUdpStop) error + func (t *BUdp) SetId(classid uint32) error + func (t *BUdp) SetLocalAddr(localip string, localport int) error + func (t *BUdp) SetNotifyThread(notifythread IBaseThread) error + func (t *BUdp) SetPacketSize(packetsize int) error + func (t *BUdp) SetRemoteAddr(remoteip string, remoteport int) error + func (t *BUdp) Start() error + func (t *BUdp) Stop() error + type BaseTcpClient struct + func NewBaseTcpClient(classid uint32, packetsize int) *BaseTcpClient + func (t *BaseTcpClient) AddTcpClient(clientid uint32, localip string, localport int, remoteip string, ...) error + func (t *BaseTcpClient) AddTcpClientWithCallback(clientid uint32, localip string, localport int, remoteip string, ...) error + func (t *BaseTcpClient) ClearTcpClient() error + func (t *BaseTcpClient) DelTcpClient(clientid uint32) error + func (t *BaseTcpClient) FreeBs(bs []byte) error + func (t *BaseTcpClient) GetTcpClientInfo(clientid uint32) (bool, *time.Time, string, int, string, int, error) + func (t *BaseTcpClient) SendData(clientid uint32, bs []byte) (int, error) + func (t *BaseTcpClient) SetFnTcpClientConn(fntcpclientconn FnTcpClientConn) error + func (t *BaseTcpClient) SetFnTcpClientDisConn(fntcpclientdisconn FnTcpClientDisConn) error + func (t *BaseTcpClient) SetFnTcpClientRcvData(fntcpclientrcvdata FnTcpClientRcvData) error + func (t *BaseTcpClient) SetNotifyThread(notifythread IBaseThread) error + func (t *BaseTcpClient) StartTcpClient(clientid uint32) error + func (t *BaseTcpClient) StopTcpClient(clientid uint32) error + type BaseThread struct + ClassId uint32 + Name string + func (t *BaseThread) DoWithMsg(classId uint32, msgId uint32, wParam uint64, lParam uint64, wInfo string, ...) int + func (t *BaseThread) Init() int + func (t *BaseThread) InitilizeThread(classId uint32, name string, fnInit FnInit, fnUnInit FnUnInit, ...) error + func (t *BaseThread) IsStart() bool + func (t *BaseThread) PostComplexMsg(classId uint32, msgId uint32, wParam uint64, lParam uint64, wInfo string, ...) error + func (t *BaseThread) PostMsg(msgId uint32, wParam uint64, lParam uint64) error + func (t *BaseThread) Start() error + func (t *BaseThread) Stop() error + func (t *BaseThread) UnInit() int + func (t *BaseThread) WaitExit() error + type BaseTimer struct + func NewBaseTimer(classid uint32) *BaseTimer + func (t *BaseTimer) AddCronTimer(timerid uint32, cron string, param uint64, info string, ...) error + func (t *BaseTimer) AddCycleTimer(timerid uint32, timerlen int, param uint64, info string, ...) error + func (t *BaseTimer) AddOnceTimer(timerid uint32, timerlen int, param uint64, info string, ...) error + func (t *BaseTimer) ClearTimer() error + func (t *BaseTimer) DelTimer(timerid uint32) error + func (t *BaseTimer) StartTimer() error + func (t *BaseTimer) StopTimer() error + type BaseUdp struct + func NewBaseUdp(classid uint32, packetsize int) *BaseUdp + func (t *BaseUdp) AddUdp(udpid uint32, localip string, localport int) error + func (t *BaseUdp) AddUdpWithCallback(udpid uint32, localip string, localport int, notifythread IBaseThread, ...) error + func (t *BaseUdp) ClearUdp() error + func (t *BaseUdp) DelUdp(udpid uint32) error + func (t *BaseUdp) FreeBs(bs []byte) error + func (t *BaseUdp) GetUdpInfo(udpid uint32) (bool, *time.Time, string, int, error) + func (t *BaseUdp) SendData(udpid uint32, remoteip string, remoteport int, bs []byte) (int, error) + func (t *BaseUdp) SetFnUdpRcvData(fnduprcvdata FnUdpRcvData) error + func (t *BaseUdp) SetFnUdpStart(fnudpstart FnUdpStart) error + func (t *BaseUdp) SetFnUdpStop(fnudpstop FnUdpStop) error + func (t *BaseUdp) SetNotifyThread(notifythread IBaseThread) error + func (t *BaseUdp) StartUdp(udpid uint32) error + func (t *BaseUdp) StopUdp(udpid uint32) error + type BytebufferPool struct + func NewBytebufferPool(size int) *BytebufferPool + func (t *BytebufferPool) GetBytebuffer() []byte + func (t *BytebufferPool) PutBytebuffer(b []byte) + type FnDoWithMsg func(classId uint32, msgId uint32, wParam uint64, lParam uint64, wInfo string, ...) int + type FnInit func() int + type FnOnTimer func(classid uint32, timerId uint32, param uint64, info string) + type FnTcpClientConn func(classId uint32, clientId uint32, localIp string, localPort int, ...) + type FnTcpClientDisConn func(classId uint32, clientId uint32, localIp string, localPort int, ...) + type FnTcpClientRcvData func(conn *net.TCPConn, classId uint32, clientId uint32, localIp string, ...) + type FnTcpServerConn func(classId uint32, serverId uint32, clientId uint32, localIp string, ...) + type FnTcpServerDisConn func(classId uint32, serverId uint32, clientId uint32, localIp string, ...) + type FnTcpServerRcvData func(conn *net.TCPConn, classId uint32, serverId uint32, clientId uint32, ...) + type FnTcpServerStart func(classId uint32, serverId uint32, localIp string, localPort int) + type FnTcpServerStop func(classId uint32, serverId uint32, localIp string, localPort int) + type FnUdpRcvData func(udpconn *net.UDPConn, classId uint32, udpId uint32, remoteIP string, ...) + type FnUdpStart func(classId uint32, udpId uint32, localIp string, localPort int) + type FnUdpStop func(classId uint32, udpId uint32, localIp string, localPort int) + type FnUnInit func() int + type IBaseThread interface + DoWithMsg func(classId uint32, msgId uint32, wParam uint64, lParam uint64, wInfo string, ...) int + Init func() int + InitilizeThread func(classId uint32, name string, fnInit FnInit, fnUnInit FnUnInit, ...) error + IsStart func() bool + PostComplexMsg func(classId uint32, msgId uint32, wParam uint64, lParam uint64, wInfo string, ...) error + PostMsg func(msgId uint32, wParam uint64, lParam uint64) error + Start func() error + Stop func() error + UnInit func() int + WaitExit func() error + type TMemStream struct + func (t *TMemStream) Append(bs []byte) + func (t *TMemStream) Clear() + func (t *TMemStream) GetAndRemove(l int) []byte + func (t *TMemStream) GetHead(l int) []byte