Documentation ¶
Index ¶
- type Session
- func (s *Session) Close() bool
- func (s *Session) GetID() int64
- func (s *Session) GetTag() interface{}
- func (s *Session) IsClosed() bool
- func (s *Session) RemoteAddr() string
- func (s *Session) Reply(header *fnet.Message, msg interface{}, status uint8) bool
- func (s *Session) Request(msg interface{}, status, serializeType uint8, indexId uint32) bool
- func (s *Session) SetID(id int64)
- func (s *Session) SetTag(tag interface{})
- func (s *Session) Start()
- type WSClient
- func (w *WSClient) AddCloseHandler(f fnet.OnCloseFunc)
- func (w *WSClient) AddConnectHandler(f fnet.OnConnectFunc)
- func (w *WSClient) GetID() int64
- func (w *WSClient) IsRunning() bool
- func (w *WSClient) Reply(header *fnet.Message, msg interface{}, status uint8) bool
- func (w *WSClient) Run()
- func (w *WSClient) Send(msg interface{}, status uint8) bool
- func (w *WSClient) SetRunning(v bool)
- func (w *WSClient) Stop()
- type WSServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { Conn *websocket.Conn OnClose func() // 关闭函数回调 // contains filtered or unexported fields }
func NewSession ¶
func (*Session) RemoteAddr ¶
type WSClient ¶
type WSClient struct { Address string Name string SerializeType fnet.SerializeType // contains filtered or unexported fields }
func NewWSClient ¶
func (*WSClient) AddCloseHandler ¶
func (w *WSClient) AddCloseHandler(f fnet.OnCloseFunc)
func (*WSClient) AddConnectHandler ¶
func (w *WSClient) AddConnectHandler(f fnet.OnConnectFunc)
func (*WSClient) SetRunning ¶
type WSServer ¶
type WSServer struct { MaxConn int // contains filtered or unexported fields }
func NewDefaultServer ¶
func (*WSServer) AddCloseHandler ¶
func (ws *WSServer) AddCloseHandler(f fnet.OnCloseFunc)
func (*WSServer) AddConnectHandler ¶
func (ws *WSServer) AddConnectHandler(f fnet.OnConnectFunc)
func (*WSServer) SetBeforeExit ¶
func (ws *WSServer) SetBeforeExit(f func())
Click to show internal directories.
Click to hide internal directories.