Documentation ¶
Index ¶
- type ConnectionClosedEventHandle
- type ConnectionOpenedEventHandle
- type ConnectionReceivePacketEventHandle
- type Websocket
- func (slf *Websocket) Close()
- func (slf *Websocket) GetData(key string) any
- func (slf *Websocket) IsConnected() bool
- func (slf Websocket) OnConnectionClosedEvent(conn *Websocket, err any)
- func (slf Websocket) OnConnectionOpenedEvent(conn *Websocket)
- func (slf Websocket) OnConnectionReceivePacketEvent(conn *Websocket, packet server.Packet)
- func (slf Websocket) RegConnectionClosedEvent(handle ConnectionClosedEventHandle)
- func (slf Websocket) RegConnectionOpenedEvent(handle ConnectionOpenedEventHandle)
- func (slf Websocket) RegConnectionReceivePacketEvent(handle ConnectionReceivePacketEventHandle)
- func (slf *Websocket) Run() error
- func (slf *Websocket) SetData(key string, value any)
- func (slf *Websocket) Write(packet server.Packet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionOpenedEventHandle ¶
type ConnectionOpenedEventHandle func(conn *Websocket)
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
Websocket websocket 客户端
func (Websocket) OnConnectionClosedEvent ¶
func (Websocket) OnConnectionOpenedEvent ¶
func (slf Websocket) OnConnectionOpenedEvent(conn *Websocket)
func (Websocket) OnConnectionReceivePacketEvent ¶
func (Websocket) RegConnectionClosedEvent ¶
func (slf Websocket) RegConnectionClosedEvent(handle ConnectionClosedEventHandle)
RegConnectionClosedEvent 注册连接关闭事件
func (Websocket) RegConnectionOpenedEvent ¶
func (slf Websocket) RegConnectionOpenedEvent(handle ConnectionOpenedEventHandle)
RegConnectionOpenedEvent 注册连接打开事件
func (Websocket) RegConnectionReceivePacketEvent ¶
func (slf Websocket) RegConnectionReceivePacketEvent(handle ConnectionReceivePacketEventHandle)
RegConnectionReceivePacketEvent 注册连接接收数据包事件
Click to show internal directories.
Click to hide internal directories.