Documentation ¶
Index ¶
- type Callback
- type Connector
- func (c *Connector) Close()
- func (c *Connector) Connected(cb func())
- func (c *Connector) IsClosed() bool
- func (c *Connector) Notify(route string, data []byte) error
- func (c *Connector) On(event string, callback Callback)
- func (c *Connector) Request(route string, data []byte, callback Callback) error
- func (c *Connector) Run(addr string) error
- func (c *Connector) SetHandshakeAckData(handshakeAck interface{}) error
- func (c *Connector) SetHandshakeData(handshake interface{}) error
- func (c *Connector) SetHandshakeRespDo(do HandShakeRespDo)
- func (c *Connector) SetHeartBeatData(heartbeat interface{}) error
- type HandShakeRespDo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(data []byte)
Callback represents the callback type which will be called when the correspond events is occurred.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector is a Pomelo client
func NewConnector ¶
func NewConnector() *Connector
func (*Connector) Close ¶
func (c *Connector) Close()
Close the connection, and shutdown the benchmark
func (*Connector) Request ¶
Request send a request to server and register a callback for the response
func (*Connector) SetHandshakeAckData ¶
SetHandshakeAckData 设置握手ACK数据
func (*Connector) SetHandshakeData ¶
SetHandshakeData 设置握手协议数据
func (*Connector) SetHandshakeRespDo ¶
func (c *Connector) SetHandshakeRespDo(do HandShakeRespDo)
func (*Connector) SetHeartBeatData ¶
SetHeartBeatData 设置心跳包数据
Click to show internal directories.
Click to hide internal directories.