Documentation ¶
Overview ¶
Package cbufftcpclient tcp client
Index ¶
- type Config
- type CtcpCli
- func (cli *CtcpCli) Close()
- func (cli *CtcpCli) ConnectToServer(ip string, port uint16) error
- func (cli *CtcpCli) DumpSendBuffer() *list.List
- func (cli *CtcpCli) SendBuffToServer(buff *list.List) error
- func (cli *CtcpCli) SendPriorToServer(msg interface{}) error
- func (cli *CtcpCli) SendPrioresToServer(msgs []interface{}) error
- func (cli *CtcpCli) SendToServer(msg interface{}) error
- type EventHandler
- type ProtocolIF
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // after recieve a whole package, the receive callback will go sync or async AsyncReceive bool }
Config extra config
type CtcpCli ¶
type CtcpCli struct {
// contains filtered or unexported fields
}
CtcpCli tcp client
func (*CtcpCli) ConnectToServer ¶
ConnectToServer connect to remote server
func (*CtcpCli) DumpSendBuffer ¶
DumpSendBuffer dump send buffer out, session's send buffer will replace with empty one
func (*CtcpCli) SendBuffToServer ¶
SendBuffToServer send buff message to server
func (*CtcpCli) SendPriorToServer ¶
SendPriorToServer send prior message to server
func (*CtcpCli) SendPrioresToServer ¶
SendPrioresToServer send prior message to server
func (*CtcpCli) SendToServer ¶
SendToServer send message to server
type EventHandler ¶
type EventHandler interface { // new connections event OnNewConnection(serverIP string, serverPort uint16) // disconnected event OnDisconnected(serverIP string, serverPort uint16) // receive data event OnReceiveData(serverIP string, serverPort uint16, pPacks []interface{}) // data already sended event OnSendedData(serverIP string, serverPort uint16, msg interface{}, bysSended []byte, length int) // error OnError(msg string, err error) // error OnErrorStr(msg string) // data protocol ProtocolIF }
EventHandler client callback control handler
Click to show internal directories.
Click to hide internal directories.