Documentation ¶
Index ¶
- Variables
- type Kind
- type Session
- func (s *Session) AddConn(conn network.Conn)
- func (s *Session) Bind(cid, uid int64) error
- func (s *Session) Broadcast(kind Kind, msg []byte, msgType ...int) (n int64, err error)
- func (s *Session) Close(kind Kind, target int64, isForce ...bool) error
- func (s *Session) Conn(kind Kind, target int64) (network.Conn, error)
- func (s *Session) Has(kind Kind, target int64) (ok bool, err error)
- func (s *Session) ID(kind Kind, target int64) (id int64, err error)
- func (s *Session) IdsStat(kind Kind) ([]string, error)
- func (s *Session) LocalAddr(kind Kind, target int64) (net.Addr, error)
- func (s *Session) LocalIP(kind Kind, target int64) (string, error)
- func (s *Session) Multicast(kind Kind, targets []int64, msg []byte, msgType ...int) (n int64, err error)
- func (s *Session) Push(kind Kind, target int64, msg []byte, msgType ...int) error
- func (s *Session) RemConn(conn network.Conn)
- func (s *Session) RemConnByCid(cid int64)
- func (s *Session) RemoteAddr(kind Kind, target int64) (net.Addr, error)
- func (s *Session) RemoteIP(kind Kind, target int64) (string, error)
- func (s *Session) Send(kind Kind, target int64, msg []byte, msgType ...int) error
- func (s *Session) Stat(kind Kind) (int64, error)
- func (s *Session) Unbind(uid int64) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFoundSession = errors.New("not found session") ErrInvalidSessionKind = errors.New("invalid session kind") )
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() *Session
func (*Session) Multicast ¶
func (s *Session) Multicast(kind Kind, targets []int64, msg []byte, msgType ...int) (n int64, err error)
Multicast 推送组播消息(异步)
func (*Session) RemConnByCid ¶ added in v0.0.23
RemConnByCid 移除连接
func (*Session) RemoteAddr ¶
RemoteAddr 获取远端地址
Click to show internal directories.
Click to hide internal directories.