Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseHandler ¶
type ResponseHandler = func(msg []byte, conn *ServerConn)
type ServerConn ¶
type ServerConn struct { WSMutex sync.Mutex // WS写锁 WS *websocket.Conn // websocket连接 Exit chan bool //退出 Flag bool //判断websocket是否已经关闭 Receive chan []byte //接收客户端的数据 Send chan interface{} //发送数据 MessageType int // contains filtered or unexported fields }
func CreateConn ¶
func CreateConn(wsConn *websocket.Conn, MessageType int) (*ServerConn, error)
CreateConn 创建连接
func (*ServerConn) Handle ¶
func (conn *ServerConn) Handle(res ResponseHandler)
Click to show internal directories.
Click to hide internal directories.