Documentation ¶
Index ¶
- Constants
- func ConnectionManagerInit()
- type AppConnection
- type Connection
- type ConnectionManager
- func (c *ConnectionManager) ClearConnection(connection *Connection)
- func (c *ConnectionManager) DeleteAppMap(sessionID, appID string)
- func (c *ConnectionManager) DeleteConnection(sessionID string)
- func (c *ConnectionManager) DeleteLiveMap(sessionID, liveID string)
- func (c *ConnectionManager) GetAppConnection(appID string) *AppConnection
- func (c *ConnectionManager) GetConnection(sessionID string) *Connection
- func (c *ConnectionManager) GetRommConnection(liveID string) *RoomConnection
- func (c *ConnectionManager) NewConnection(con *websocket.Conn, wsConnInfo *proto.WsConnectInfo) *Connection
- type RoomConnection
Constants ¶
View Source
const (
DATA_CHAN_MAX_LEN = 1024 // 每个连接通道最多缓存1024条消息
)
Variables ¶
This section is empty.
Functions ¶
func ConnectionManagerInit ¶
func ConnectionManagerInit()
Types ¶
type AppConnection ¶
type AppConnection struct {
Connections cmap.ConcurrentMap
}
type Connection ¶
type Connection struct { // ReadPackNum uint64 // WritePackNum uint64 Conn *websocket.Conn WsConnectInfo *proto.WsConnectInfo DataCh chan []byte }
type ConnectionManager ¶
type ConnectionManager struct { Mutex *sync.Mutex LastEnterTime int64 // 最后入场时间 ConnectionMap cmap.ConcurrentMap // 按客户端 LiveMap cmap.ConcurrentMap // 按房间分组 AppMap cmap.ConcurrentMap // 按渠道分组 }
func GetConnectionManager ¶
func GetConnectionManager() *ConnectionManager
func (*ConnectionManager) ClearConnection ¶
func (c *ConnectionManager) ClearConnection(connection *Connection)
func (*ConnectionManager) DeleteAppMap ¶
func (c *ConnectionManager) DeleteAppMap(sessionID, appID string)
func (*ConnectionManager) DeleteConnection ¶
func (c *ConnectionManager) DeleteConnection(sessionID string)
func (*ConnectionManager) DeleteLiveMap ¶
func (c *ConnectionManager) DeleteLiveMap(sessionID, liveID string)
func (*ConnectionManager) GetAppConnection ¶
func (c *ConnectionManager) GetAppConnection(appID string) *AppConnection
func (*ConnectionManager) GetConnection ¶
func (c *ConnectionManager) GetConnection(sessionID string) *Connection
func (*ConnectionManager) GetRommConnection ¶
func (c *ConnectionManager) GetRommConnection(liveID string) *RoomConnection
func (*ConnectionManager) NewConnection ¶
func (c *ConnectionManager) NewConnection(con *websocket.Conn, wsConnInfo *proto.WsConnectInfo) *Connection
type RoomConnection ¶
type RoomConnection struct {
Connections cmap.ConcurrentMap
}
Click to show internal directories.
Click to hide internal directories.