Documentation ¶
Index ¶
- Variables
- type Group
- func (g *Group) AddSession(sess *Session)
- func (g *Group) Broadcast(kind Kind, msg []byte, msgType ...int) (n int, err error)
- func (g *Group) GetSession(kind Kind, target int64) (*Session, error)
- func (g *Group) Multicast(kind Kind, targets []int64, msg []byte, msgType ...int) (n int, err error)
- func (g *Group) Push(kind Kind, target int64, msg []byte, msgType ...int) error
- func (g *Group) RemSession(kind Kind, target int64) (*Session, error)
- func (g *Group) Send(kind Kind, target int64, msg []byte, typ ...int) error
- type Kind
- type Session
- func (s *Session) AddToGroups(groups ...*Group)
- func (s *Session) Bind(uid int64)
- func (s *Session) CID() int64
- func (s *Session) Close(isForce ...bool) error
- func (s *Session) Init(conn network.Conn)
- func (s *Session) LocalAddr() (net.Addr, error)
- func (s *Session) LocalIP() (string, error)
- func (s *Session) Push(msg []byte, msgType ...int) error
- func (s *Session) RemFromGroups(groups ...*Group)
- func (s *Session) RemoteAddr() (net.Addr, error)
- func (s *Session) RemoteIP() (string, error)
- func (s *Session) Reset()
- func (s *Session) Send(msg []byte, msgType ...int) error
- func (s *Session) UID() int64
- func (s *Session) Unbind(uid int64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFoundSession = errors.New("the session not found in the group") ErrInvalidSessionKind = errors.New("invalid session kind") )
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) GetSession ¶
GetSession 获取会话
func (*Group) Multicast ¶
func (g *Group) Multicast(kind Kind, targets []int64, msg []byte, msgType ...int) (n int, err error)
Multicast 推送组播消息(异步)
func (*Group) RemSession ¶
RemSession 移除会话
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() *Session
func (*Session) AddToGroups ¶ added in v0.0.4
AddToGroups 添加到会话组
func (*Session) RemFromGroups ¶ added in v0.0.4
RemFromGroups 从会话组移除
Click to show internal directories.
Click to hide internal directories.