Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultSendBuffSize default send buff size
DefaultSendBuffSize = 1 * 10000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // tcp send buff size SendBuffsize int // after recieve a whole package, the receive callback will go async or sync AsyncReceive bool // after data write to tcp sys buff, do OnSendedData() call back require RequireSendedCb bool // sended callback if async or sync AsyncSended 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) ConnectToServer_Timeout ¶ added in v0.1.3
ConnectToServer connect to remote server
func (*CtcpCli) SendToServer ¶
SendToServer send message to server
@return busy bool : true -- buff is full, you may need to try again
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) // event OnEvent(msg string) // 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.