{"action":"created","issue":{"url":"https://api.github.com/repos/NetEase/pomelo/issues/760","repository_url":"https://api.github.com/repos/NetEase/pomelo","labels_url":"https://api.github.com/repos/NetEase/pomelo/issues/760/labels{/name}","comments_url":"https://api.github.com/repos/NetEase/pomelo/issues/760/comments","events_url":"https://api.github.com/repos/NetEase/pomelo/issues/760/events","html_url":"https://github.com/NetEase/pomelo/issues/760","id":110766418,"number":760,"title":"catch error \"ECONNRESET\"","user":{"login":"hikaru7641","id":7581097,"avatar_url":"https://avatars.githubusercontent.com/u/7581097?v=3","gravatar_id":"","url":"https://api.github.com/users/hikaru7641","html_url":"https://github.com/hikaru7641","followers_url":"https://api.github.com/users/hikaru7641/followers","following_url":"https://api.github.com/users/hikaru7641/following{/other_user}","gists_url":"https://api.github.com/users/hikaru7641/gists{/gist_id}","starred_url":"https://api.github.com/users/hikaru7641/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikaru7641/subscriptions","organizations_url":"https://api.github.com/users/hikaru7641/orgs","repos_url":"https://api.github.com/users/hikaru7641/repos","events_url":"https://api.github.com/users/hikaru7641/events{/privacy}","received_events_url":"https://api.github.com/users/hikaru7641/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-10T04:07:44Z","updated_at":"2016-04-27T02:42:59Z","closed_at":"2015-10-10T04:07:49Z","body":"My game server:\r\n   + 1 location server\r\n   + 3 connector (use hybridsocket)\r\n\r\nWhen running , sometime server connector crash with uncaughtExceptionerror: \"ECONNRESET\".\r\n\r\nMy solution catch this error:\r\nAdd event \"error\" for hybridsocket on hybridconnector.js\r\n```\r\n............\r\nhybridsocket.on('disconnect', self.heartbeat.clear.bind(self.heartbeat, hybridsocket.id));\r\nhybridsocket.on('closing', Kick.handle.bind(null, hybridsocket));\r\nhybridsocket.on('error', function(error){\r\n        console.log('hybridsocket error');\r\n        console.dir(error);\r\n    });\r\n.....................\r\n```\r\n\r\nWhen add event error, i only see console log error and connector server not crash ;)\r\n\"{ [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }\"\r\n\r\nHope this help for somebody ^^."},"comment":{"url":"https://api.github.com/repos/NetEase/pomelo/issues/comments/214953818","html_url":"https://github.com/NetEase/pomelo/issues/760#issuecomment-214953818","issue_url":"https://api.github.com/repos/NetEase/pomelo/issues/760","id":214953818,"user":{"login":"hikaru7641","id":7581097,"avatar_url":"https://avatars.githubusercontent.com/u/7581097?v=3","gravatar_id":"","url":"https://api.github.com/users/hikaru7641","html_url":"https://github.com/hikaru7641","followers_url":"https://api.github.com/users/hikaru7641/followers","following_url":"https://api.github.com/users/hikaru7641/following{/other_user}","gists_url":"https://api.github.com/users/hikaru7641/gists{/gist_id}","starred_url":"https://api.github.com/users/hikaru7641/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikaru7641/subscriptions","organizations_url":"https://api.github.com/users/hikaru7641/orgs","repos_url":"https://api.github.com/users/hikaru7641/repos","events_url":"https://api.github.com/users/hikaru7641/events{/privacy}","received_events_url":"https://api.github.com/users/hikaru7641/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T02:42:59Z","updated_at":"2016-04-27T02:42:59Z","body":"maybe you have error \"ECONNRESET\" so Connector-server will crash,\r\nyou try change code in pomelo/lib/hybridconnector.js:\r\n`this.tcpServer = net.createServer();\r\n===>\r\n\r\n// edit by nes\r\nthis.tcpServer = net.createServer(function(socket){\r\nsocket.on('error', function(err2) {\r\nconsole.error('tcpServer ERROR:', err2);\r\n});\r\n});`"}}