Documentation
¶
Index ¶
- func NewWrapConnection(netConn net.Conn) *connection
- type Conn
- type Context
- type Property
- type Server
- func (server *Server) OnConnect(handler func(conn Conn)) *Server
- func (server *Server) OnDisconnect(handler func(conn Conn)) *Server
- func (server *Server) OnMessage(handler func(ctx *Context)) *Server
- func (server *Server) Serve(stop <-chan struct{})
- func (server *Server) Shutdown()
- func (server *Server) WithWorker(worker int) *Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWrapConnection ¶
Types ¶
type Context ¶
func NewContext ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provide the websocket server.
func (*Server) OnDisconnect ¶
OnDisconnect is set callback when the client disconnects from the server
func (*Server) Serve ¶
func (server *Server) Serve(stop <-chan struct{})
Serve start websocket server
func (*Server) WithWorker ¶
WithWorker sets the concurrent worker threads.
Click to show internal directories.
Click to hide internal directories.