Documentation
¶
Index ¶
- func NewWsServer() *socketio.Server
- type ConfirmMsg
- type ConfirmMsgWorker
- type ConnRoomChangeInfo
- type EnsureMsgSendInfo
- type MsgDispatcher
- type MsgManager
- func (s *MsgManager) ConfirmMsg(conn socketio.Conn, msgId string)
- func (s *MsgManager) DispatchMsg(room, postData, isEnsure string)
- func (s *MsgManager) JoinRoom(room string, conn socketio.Conn)
- func (s *MsgManager) LeaveAllRoom(conn socketio.Conn)
- func (s *MsgManager) LeaveRoom(room string, conn socketio.Conn)
- func (s *MsgManager) RoomHasConn(room string, conn socketio.Conn) bool
- func (s *MsgManager) Run()
- type MsgRoom
- type MsgWorker
- type PostMsg
- type ReSendMsgWorker
- type RingQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWsServer ¶
func NewWsServer() *socketio.Server
Types ¶
type ConfirmMsgWorker ¶
type ConfirmMsgWorker struct { ConfirmMsgChanPool chan chan *ConfirmMsg // contains filtered or unexported fields }
接收客户端消息回执的worker
type ConnRoomChangeInfo ¶
type ConnRoomChangeInfo struct { Room string Conn socketio.Conn }
用于离开和加入房间时通过通道同步数据
type EnsureMsgSendInfo ¶
type MsgDispatcher ¶
type MsgDispatcher struct { ConfirmMsgChan chan *ConfirmMsg //客户端消息确认同步通道 ConfirmMsgChanPool chan chan *ConfirmMsg EnsureMsgSendMap map[string]*EnsureMsgSendInfo //存放消息的id和客户端id的映射,以及该发送给该客户端发送消息的时间 // contains filtered or unexported fields }
func NewMsgDispatcher ¶
func NewMsgDispatcher(msgWorkerNum, confirmMsgWorkerNum, reSendWorkerNum int) *MsgDispatcher
创建消息分发器,并初始化消息工作者
type MsgManager ¶
type MsgManager struct { JoinRoomChan chan *ConnRoomChangeInfo //离开房间的通信通道 LeavaRoomChan chan *ConnRoomChangeInfo //进入房间的通信通道 LeaveAllRoomChan chan socketio.Conn //用于客户端异常断开等情况退出所有房间 // contains filtered or unexported fields }
func GetMsgManager ¶
func GetMsgManager() *MsgManager
func (*MsgManager) ConfirmMsg ¶
func (s *MsgManager) ConfirmMsg(conn socketio.Conn, msgId string)
func (*MsgManager) DispatchMsg ¶
func (s *MsgManager) DispatchMsg(room, postData, isEnsure string)
func (*MsgManager) JoinRoom ¶
func (s *MsgManager) JoinRoom(room string, conn socketio.Conn)
func (*MsgManager) LeaveAllRoom ¶
func (s *MsgManager) LeaveAllRoom(conn socketio.Conn)
func (*MsgManager) LeaveRoom ¶
func (s *MsgManager) LeaveRoom(room string, conn socketio.Conn)
func (*MsgManager) RoomHasConn ¶
func (s *MsgManager) RoomHasConn(room string, conn socketio.Conn) bool
检查某一个链接是否在某一个房间内
func (*MsgManager) Run ¶
func (s *MsgManager) Run()
type MsgRoom ¶
type ReSendMsgWorker ¶
type ReSendMsgWorker struct { ReSendMsgChan chan []string //用于接收ws客户端发送的确认消息回执 ReSendChanPool chan chan []string // contains filtered or unexported fields }
接收客户端消息回执的worker
type RingQueue ¶
type RingQueue struct {
// contains filtered or unexported fields
}
func NewRingQueue ¶
Click to show internal directories.
Click to hide internal directories.