Documentation ¶
Index ¶
- Variables
- func NewWsClient(schema string, ip string, port string, path string, timeout time.Duration) *client
- func RegistDisconnectedHandler(handler func(connectSessionId string))
- func RegistMessageHandler(...)
- func SendRaw(sessionId string, data []byte) error
- func Start()
- type WebsocketConnection
- type WebsocketMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var WebsocketConnectionPool = make(map[string]*WebsocketConnection)
WebsocketConnectionPool connectsessionId与websocketconnection的映射
Functions ¶
func NewWsClient ¶
构造函数
func RegistDisconnectedHandler ¶
func RegistDisconnectedHandler(handler func(connectSessionId string))
Types ¶
type WebsocketConnection ¶
type WebsocketConnection struct { Session *session2.Session WsConnect *websocket.Conn // contains filtered or unexported fields }
func (*WebsocketConnection) Close ¶
func (conn *WebsocketConnection) Close()
type WebsocketMessage ¶
type WebsocketMessage struct {
// contains filtered or unexported fields
}
自己实现的基于gorilla websocket的独立服务端,能够处理超大连接数
Click to show internal directories.
Click to hide internal directories.