{"action":"created","issue":{"url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/31","labels_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/31/comments","events_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/31/events","html_url":"https://github.com/nuclearace/Socket.IO-Client-Swift/issues/31","id":64485224,"number":31,"title":"Unexpected behavior of socket connection","user":{"login":"waphumanoid","id":11607959,"avatar_url":"https://avatars.githubusercontent.com/u/11607959?v=3","gravatar_id":"","url":"https://api.github.com/users/waphumanoid","html_url":"https://github.com/waphumanoid","followers_url":"https://api.github.com/users/waphumanoid/followers","following_url":"https://api.github.com/users/waphumanoid/following{/other_user}","gists_url":"https://api.github.com/users/waphumanoid/gists{/gist_id}","starred_url":"https://api.github.com/users/waphumanoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waphumanoid/subscriptions","organizations_url":"https://api.github.com/users/waphumanoid/orgs","repos_url":"https://api.github.com/users/waphumanoid/repos","events_url":"https://api.github.com/users/waphumanoid/events{/privacy}","received_events_url":"https://api.github.com/users/waphumanoid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/labels/unconfirmed","name":"unconfirmed","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-03-26T09:59:26Z","updated_at":"2015-03-27T13:37:09Z","closed_at":null,"body":"Good day. I was working with the library all day long and unfortunately facing a lot of strange behavior. A socket connects pretty fast but then it looks like it often falls down (?) to long polling and cannot receive any message from a server. When I close a socket it can suddenly continue to reconnect repeatedly.\r\nI've got a browser socket client running at the same time on the same mac and it receives messages just in time while the iOS client keeps silence (between reconnect attempts).\r\n\r\nAttaching a log to show a regular case (I sent a lot of testing messages through the server before calling [socket closeWithFast:YES] method but no luck):\r\n\r\n2015-03-26 19:29:26.344\r\nparsePollingMessage: 2:40\r\nShould do event: \"connect\" with data: \"nil\"\r\nSending ws: probe as type: 2\r\nSending poll:  as type: 6\r\n2015-03-26 19:29:26.523\r\n\r\n/*\r\nCalling:\r\n[socket on:@\"connect\" callback:^(NSArray *data, void (^ack)(NSArray *)) {\r\n        [socket emitObjc:@\"join room\" withItems:@[@\"/threads/drom-static/parom\"]];\r\n    }];\r\n*/\r\n\r\nSending poll: 2[\"join room\",[\"\\/threads\\/drom-static\\/parom\"]] as type: 4\r\n2015-03-26 19:29:26.546\r\nparsePollingMessage: 1:6\r\nSending ws:  as type: 5\r\nparsePollingMessage: {\"code\":3,\"message\":\"Bad request\"}\r\nShould do event: \"reconnect\" with data: \"Optional([Error parsing XHR message])\"\r\nShould do event: \"reconnectAttempt\" with data: \"Optional([-1])\"\r\nSending ws: probe as type: 2\r\nSending poll:  as type: 6\r\nShould do event: \"reconnect\" with data: \"Optional([Socket Disconnect])\"\r\nShould do event: \"reconnectAttempt\" with data: \"Optional([-2])\"\r\nparsePollingMessage: 2:40\r\nShould do event: \"connect\" with data: \"nil\"\r\nSending ws:  as type: 5\r\nSending ws: probe as type: 2\r\n\r\n/*\r\nCalling:\r\n[socket on:@\"connect\" callback:^(NSArray *data, void (^ack)(NSArray *)) {\r\n        [socket emitObjc:@\"join room\" withItems:@[@\"/threads/drom-static/parom\"]];\r\n    }];\r\n*/\r\n\r\n2015-03-26 19:29:27.041\r\nSending ws:  as type: 2\r\nSending ws:  as type: 2\r\nSending ws:  as type: 2\r\nSending ws:  as type: 2\r\n\r\n/*\r\nCalling:\r\n[socket closeWithFast:YES];\r\n*/\r\n\r\nShould do event: \"disconnect\" with data: \"Optional([Fast Disconnect])\"\r\n2015-03-26 19:30:26.389\r\nShould do event: \"reconnectAttempt\" with data: \"Optional([-1])\"\r\nWarning! This socket was previously closed. This might be dangerous!\r\nShould do event: \"reconnectAttempt\" with data: \"Optional([-2])\"\r\n2015-03-26 19:30:26.729\r\nparsePollingMessage: 2:40\r\nShould do event: \"connect\" with data: \"nil\"\r\n2015-03-26 19:30:26.766\r\n\r\n/*\r\nCalling:\r\n[socket on:@\"connect\" callback:^(NSArray *data, void (^ack)(NSArray *)) {\r\n        [socket emitObjc:@\"join room\" withItems:@[@\"/threads/drom-static/parom\"]];\r\n    }];\r\n*/\r\n\r\nSending poll: 2[\"join room\",[\"\\/threads\\/drom-static\\/parom\"]] as type: 4\r\nSending ws: probe as type: 2\r\nparsePollingMessage: 2:40\r\nShould do event: \"connect\" with data: \"nil\"\r\nSending ws: probe as type: 2\r\n2015-03-26\r\nSending poll:  as type: 6\r\nSending poll:  as type: 6\r\npSarsePolelningMedssage: 1:i6\r\nng ws:  as type: 5\r\nSending ws: 2[\"join room\",[\"\\/threads\\/drom-static\\/parom\"]] as type: 4\r\n\r\n… repeated indefinitely\r\n"},"comment":{"url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/comments/86941808","html_url":"https://github.com/nuclearace/Socket.IO-Client-Swift/issues/31#issuecomment-86941808","issue_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/31","id":86941808,"user":{"login":"nuclearace","id":1211049,"avatar_url":"https://avatars.githubusercontent.com/u/1211049?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearace","html_url":"https://github.com/nuclearace","followers_url":"https://api.github.com/users/nuclearace/followers","following_url":"https://api.github.com/users/nuclearace/following{/other_user}","gists_url":"https://api.github.com/users/nuclearace/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearace/subscriptions","organizations_url":"https://api.github.com/users/nuclearace/orgs","repos_url":"https://api.github.com/users/nuclearace/repos","events_url":"https://api.github.com/users/nuclearace/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearace/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T13:37:09Z","updated_at":"2015-03-27T13:37:09Z","body":"As for your original problem, I'm still having trouble reproducing"}}