This commit is contained in:
laodaming 2023-10-26 18:34:25 +08:00
parent 43d5fe6692
commit d69f0e4d72
2 changed files with 9 additions and 9 deletions

View File

@ -74,15 +74,6 @@ var (
websocketOutChanLen = 2000
)
// 用户标识的连接增删操作队列传输的值的结构
type userConnPoolCtlChanItem struct {
userId int64 //必须两个用户id任意一个不为0
guestId int64 //必须两个用户id任意一个不为0
uniqueId string //主连接池唯一标识(添加/删除时候必须)
message []byte //消息(发送消息传的,格式是经过标准输出序列化后的数据)
option int64 //操作 2发消息 1增加 0删除
}
// 每个连接的连接基本属性
type wsConnectItem struct {
conn *websocket.Conn //websocket的连接(基本属性)

View File

@ -13,6 +13,15 @@ var (
userConnPoolCtlChan = make(chan userConnPoolCtlChanItem, 500)
)
// 用户标识的连接增删操作队列传输的值的结构
type userConnPoolCtlChanItem struct {
userId int64 //必须两个用户id任意一个不为0
guestId int64 //必须两个用户id任意一个不为0
uniqueId string //主连接池唯一标识(添加/删除时候必须)
message []byte //消息(发送消息传的,格式是经过标准输出序列化后的数据)
option int64 //操作 2发消息 1增加 0删除
}
// 添加用户索引池ws连接
func createUserConnPoolElement(userId, guestId int64, uniqueId string) {
if userId == 0 && guestId == 0 {