Documentation ¶
Index ¶
- Constants
- type WebSocket
- type WsClient
- func (this *WsClient) AsyncCall(transId uint32, req interface{}) (interface{}, error)
- func (this *WsClient) Call(transId uint32, req interface{}) (interface{}, error)
- func (this *WsClient) ClearContext()
- func (this *WsClient) Close() *promise.Promise
- func (this *WsClient) Connect(addr string) *promise.Promise
- func (this *WsClient) Connected() bool
- func (this *WsClient) Disconnect(force bool) *promise.Promise
- func (this *WsClient) HookRecv(data []byte) (interface{}, error)
- func (this *WsClient) Off(cmdId uint16, listener events.Listener)
- func (this *WsClient) OnClose(conn *websocket.Conn)
- func (this *WsClient) OnMessage(cmdId protocol.BINARY_TAG, listeners ...events.Listener)
- func (this *WsClient) OnOpen(conn *websocket.Conn)
- func (this *WsClient) OnRecv(connect lokas.IConn, data []byte)
- func (this *WsClient) OnRecvCmd(cmdId protocol.BINARY_TAG, time time.Duration) *promise.Promise
- func (this *WsClient) OnRecvData(data []byte)
- func (this *WsClient) OnRecvMessage(cmdId protocol.BINARY_TAG, transId uint32, msg interface{})
- func (this *WsClient) Open() *promise.Promise
- func (this *WsClient) Request(req interface{}) *promise.Promise
- func (this *WsClient) Run()
- func (this *WsClient) SendMessage(transId uint32, msg interface{})
Constants ¶
View Source
const ( HeaderSize = 8 ProtectLongPacketSize = 4 * 1024 * 1024 )
View Source
const (
TimeOut = time.Second * 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WsClient ¶
type WsClient struct { events.EventEmmiter Closing bool Opening bool // contains filtered or unexported fields }
func NewWsClient ¶
func NewWsClient() *WsClient
func (*WsClient) ClearContext ¶
func (this *WsClient) ClearContext()
func (*WsClient) OnMessage ¶
func (this *WsClient) OnMessage(cmdId protocol.BINARY_TAG, listeners ...events.Listener)
func (*WsClient) OnRecvData ¶
func (*WsClient) OnRecvMessage ¶
func (this *WsClient) OnRecvMessage(cmdId protocol.BINARY_TAG, transId uint32, msg interface{})
func (*WsClient) SendMessage ¶
Click to show internal directories.
Click to hide internal directories.