{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io/issues/430","repository_url":"https://api.github.com/repos/socketio/socket.io","labels_url":"https://api.github.com/repos/socketio/socket.io/issues/430/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io/issues/430/comments","events_url":"https://api.github.com/repos/socketio/socket.io/issues/430/events","html_url":"https://github.com/socketio/socket.io/issues/430","id":1301179,"number":430,"title":"Multiple sockets open after reconnect","user":{"login":"theyak","id":211792,"avatar_url":"https://avatars1.githubusercontent.com/u/211792?v=4","gravatar_id":"","url":"https://api.github.com/users/theyak","html_url":"https://github.com/theyak","followers_url":"https://api.github.com/users/theyak/followers","following_url":"https://api.github.com/users/theyak/following{/other_user}","gists_url":"https://api.github.com/users/theyak/gists{/gist_id}","starred_url":"https://api.github.com/users/theyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theyak/subscriptions","organizations_url":"https://api.github.com/users/theyak/orgs","repos_url":"https://api.github.com/users/theyak/repos","events_url":"https://api.github.com/users/theyak/events{/privacy}","received_events_url":"https://api.github.com/users/theyak/received_events","type":"User","site_admin":false},"labels":[{"id":80315,"url":"https://api.github.com/repos/socketio/socket.io/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":124366,"url":"https://api.github.com/repos/socketio/socket.io/labels/Socket.IO%20client","name":"Socket.IO client","color":"FF6600","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":42,"created_at":"2011-07-28T07:19:29Z","updated_at":"2018-05-12T00:37:37Z","closed_at":"2014-08-19T00:24:53Z","author_association":"NONE","body":"I've noticed this both on my socket.io application and someone else's. When a reconnect occurs, it's common for more than one socket within a client to be open, which should never happen.\n\nHere's a log I got from my own test application when I had a disconnect/reconnect.\n\n**\\* Disconnect\n**\\* Reconnecting with delay 1000 Attempts: 1\n**\\* Reconnecting with delay 2000 Attempts: 2\n**\\* Connecting with xhr-polling\n**\\* Connecting with xhr-polling\n**\\* Reconnect with transport type xhr-polling Attempts: 2\n**\\* Connected\n**\\* Connected\n\nWhen this happens, I get duplicate messages sent, one for each connected socket, even though there should only be one. It is confirmed by Firebug that there are, in fact, two sockets from the client connected. My best guess is that this is in the client code, perhaps not closing the first reconnection attempt.\n\nOf course, the real question might be why was there a disconnect in the first place?\n"},"comment":{"url":"https://api.github.com/repos/socketio/socket.io/issues/comments/388517344","html_url":"https://github.com/socketio/socket.io/issues/430#issuecomment-388517344","issue_url":"https://api.github.com/repos/socketio/socket.io/issues/430","id":388517344,"user":{"login":"leemlwando","id":32931161,"avatar_url":"https://avatars1.githubusercontent.com/u/32931161?v=4","gravatar_id":"","url":"https://api.github.com/users/leemlwando","html_url":"https://github.com/leemlwando","followers_url":"https://api.github.com/users/leemlwando/followers","following_url":"https://api.github.com/users/leemlwando/following{/other_user}","gists_url":"https://api.github.com/users/leemlwando/gists{/gist_id}","starred_url":"https://api.github.com/users/leemlwando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leemlwando/subscriptions","organizations_url":"https://api.github.com/users/leemlwando/orgs","repos_url":"https://api.github.com/users/leemlwando/repos","events_url":"https://api.github.com/users/leemlwando/events{/privacy}","received_events_url":"https://api.github.com/users/leemlwando/received_events","type":"User","site_admin":false},"created_at":"2018-05-12T00:37:37Z","updated_at":"2018-05-12T00:37:37Z","author_association":"NONE","body":"Apparently, when the socket_handlers are places withing routes, they are called multiple times. Use the socket connection within app.js and require handlers within the socket connection, pass the socket as a parameter. Note that some properties may not be shiped together with the socket instance"}}
{"actor":{"display_login":"leemlwando"}}