fix
This commit is contained in:
@@ -238,7 +238,7 @@ func (l *DataTransferLogic) setConnPool(conn *websocket.Conn, userInfo *auth.Use
|
||||
if isFirefoxBrowser {
|
||||
time.Sleep(time.Second * 1) //兼容下火狐(直接发回去收不到第一条消息:有待研究)
|
||||
}
|
||||
ws.sendToOutChan(ws.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, websocket_data.ConnectSuccessMsg{Wid: uniqueId}))
|
||||
ws.sendToOutChan(ws.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, websocket_data.ConnectSuccessMsg{Wid: uniqueId, Debug: ws.debug != nil}))
|
||||
//发送累加统计连接书
|
||||
increaseWebsocketConnectCount()
|
||||
return ws, nil
|
||||
@@ -452,9 +452,8 @@ func (w *wsConnectItem) sendToInChan(data []byte) {
|
||||
// 格式化为websocket标准返回格式
|
||||
func (w *wsConnectItem) respondDataFormat(msgType constants.Websocket, data interface{}) []byte {
|
||||
d := websocket_data.DataTransferData{
|
||||
T: msgType,
|
||||
D: data,
|
||||
Debug: w.debug != nil,
|
||||
T: msgType,
|
||||
D: data,
|
||||
}
|
||||
b, _ := json.Marshal(d)
|
||||
return b
|
||||
|
||||
Reference in New Issue
Block a user