Versions in this module Expand all Collapse all v1 v1.1.0 Dec 9, 2020 Changes in this version + type Client struct + BufferPool *util.BufferPool + Conn *Connection + CreateReceiver func(conn netConn.IConnection, data []byte) []netConn.IReceiver + IP string + Network string + OnConnStart func(conn netConn.IConnection) + OnConnStop func(conn netConn.IConnection) + OnReceiveCompleted func(conn netConn.IConnection, data []byte) + Port int + func (c *Client) CallOnConnStart(conn netConn.IConnection) + func (c *Client) CallOnConnStop(conn netConn.IConnection) + func (c *Client) CallOnReceiveCompleted(conn netConn.IConnection, data []byte) + func (c *Client) Connect() bool + func (c *Client) GetConn() netConn.IConnection + func (c *Client) SetCreateReceiver(hookFunc func(netConn.IConnection, []byte) []netConn.IReceiver) + func (c *Client) SetOnConnStart(hookFunc func(netConn.IConnection)) + func (c *Client) SetOnConnStop(hookFunc func(netConn.IConnection)) + func (c *Client) SetOnReceiveCompleted(hookFunc func(netConn.IConnection, []byte)) + func (c *Client) Stop() + type Connection struct + Client *Client + Conn net.Conn + ExitBuffChan chan bool + HeartTime time.Time + PackCount int64 + func NewConntion(client *Client, conn net.Conn) *Connection + func (c *Connection) CreateReceiver(data []byte) []netConn.IReceiver + func (c *Connection) GetBytesCache() *bytes.Buffer + func (c *Connection) GetConnId() uint64 + func (c *Connection) GetNetConn() net.Conn + func (c *Connection) GetPackCount() int64 + func (c *Connection) GetProperty(key string) (interface{}, error) + func (c *Connection) GetReceiver() []netConn.IReceiver + func (c *Connection) GetRemoteAddr() net.Addr + func (c *Connection) OnCompleted(data []byte, offset int, count int) + func (c *Connection) OnReceiveCompleted(data []byte) + func (c *Connection) RemoveProperty(key string) + func (c *Connection) SendData(data []byte) error + func (c *Connection) SendDataCall(data []byte, pram interface{}, ...) error + func (c *Connection) SetProperty(key string, value interface{}) + func (c *Connection) Start() + func (c *Connection) Stop() + type IClient interface + Connect func() bool + GetConn func() netConn.IConnection + SetCreateReceiver func(hookFunc func(netConn.IConnection, []byte) []netConn.IReceiver) + SetOnConnStart func(hookFunc func(netConn.IConnection)) + SetOnConnStop func(hookFunc func(netConn.IConnection)) + SetOnReceiveCompleted func(hookFunc func(netConn.IConnection, []byte)) + Stop func() + func NewClient(network string, ip string, port int) IClient