Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Testwg sync.WaitGroup TestWSServer *Server TestHandlerC *TestWSHandler TestHandlerS *TestWSHandler )
Functions ¶
func NewTestWSHandler ¶
func NewWSServer ¶
Types ¶
type ClientConf ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
A Connction is related with one user When User reconnect, conn will re-related to connection
func WSConnect ¶
func WSConnect(conf *ClientConf, h anet.Handler, wg *sync.WaitGroup, onConnect anet.OnConnect, onDisconnect anet.OnDisconnect) *Connection
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Lctx ¶
func (c *Connection) Lctx() *alog.LogCtx
func (*Connection) Prefix ¶
func (c *Connection) Prefix() string
func (*Connection) Suffix ¶
func (c *Connection) Suffix() string
type CreateHandler ¶
type CreateHandler func(*Connection) anet.Handler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(c *ServerConf) *Server
func (*Server) RegisteHandler ¶
func (s *Server) RegisteHandler(path string, ch CreateHandler)
type ServerConf ¶
type TestWSHandler ¶
Click to show internal directories.
Click to hide internal directories.