socket io changes socket.id repeatedly

2019-05-30 11:09发布

问题:

Is this normal behavior? socket.io-1.3.2.js From the client:

socket = io.connect('https://socket.myserver.nl');
    socket.on('connect', function() {
    socket.emit('register', userID, 'Lobby');//ignore this
    });

At the server Node version v5.2.0:

 io.sockets.on('connection', function (socket) {
    console.log('SOCKET CONNECTING '+socket.id); 
  ////lots of other code//////////


  socket.on('disconnect', function() {  
    console.log('SOCKET DISCONNECTING '+socket.id);    
  });
  });

During test when i make a single connection with a client to the server and further doing absolutely nothing i get the following (5 minutes approximately):

SOCKET CONNECTING SddHIXmWSeHEfDnlAAAC

SOCKET DISCONNECTING SddHIXmWSeHEfDnlAAAC

SOCKET CONNECTING o0zj7GE1tlO3RQw1AAAD

SOCKET DISCONNECTING o0zj7GE1tlO3RQw1AAAD

SOCKET CONNECTING lAnfvaF3DXMyhc6lAAAE

SOCKET DISCONNECTING lAnfvaF3DXMyhc6lAAAE

SOCKET CONNECTING tP3cjtJ-VpPPjoG2AAAF

SOCKET DISCONNECTING tP3cjtJ-VpPPjoG2AAAF

SOCKET CONNECTING a2o13T7CgcKDEbppAAAG

SOCKET DISCONNECTING a2o13T7CgcKDEbppAAAG

SOCKET CONNECTING avogGTh0KVtLFOqNAAAH

SOCKET DISCONNECTING avogGTh0KVtLFOqNAAAH

SOCKET CONNECTING usoQGxKAMsth2zTcAAAI

SOCKET DISCONNECTING usoQGxKAMsth2zTcAAAI

question continues here: socket-io-changes-socket-id-repeatedly part 2