root 1 year ago
parent
commit
23ca2df141
1 changed files with 7 additions and 0 deletions
  1. 7 0
      node/message.js

+ 7 - 0
node/message.js

@@ -637,6 +637,13 @@ us.polling = function (requset, response, userid, pageid, type) {
             ;
         //获取当前连接的用户,如果获取成功那么直接修改用户的连接
         if (_userarray[pageid]) {
+            //防止重复多连
+            try {
+                _userarray[pageid].response.end("");
+            }
+            catch (e) {
+
+            }
             _userarray[pageid].response = response;
             if (_messagearray && _messagearray.message.length > 0) {
                 response.write(JSON.stringify(_messagearray.message) + "\r\n");