{"action":"created","issue":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2637","repository_url":"https://api.github.com/repos/aio-libs/aiohttp","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2637/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2637/comments","events_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2637/events","html_url":"https://github.com/aio-libs/aiohttp/issues/2637","id":285275709,"number":2637,"title":"Stop server error","user":{"login":"johnroper100","id":9782943,"avatar_url":"https://avatars3.githubusercontent.com/u/9782943?v=4","gravatar_id":"","url":"https://api.github.com/users/johnroper100","html_url":"https://github.com/johnroper100","followers_url":"https://api.github.com/users/johnroper100/followers","following_url":"https://api.github.com/users/johnroper100/following{/other_user}","gists_url":"https://api.github.com/users/johnroper100/gists{/gist_id}","starred_url":"https://api.github.com/users/johnroper100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnroper100/subscriptions","organizations_url":"https://api.github.com/users/johnroper100/orgs","repos_url":"https://api.github.com/users/johnroper100/repos","events_url":"https://api.github.com/users/johnroper100/events{/privacy}","received_events_url":"https://api.github.com/users/johnroper100/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-31T20:48:42Z","updated_at":"2017-12-31T21:26:19Z","closed_at":null,"author_association":"NONE","body":"## Long story short\r\n\r\nI'm trying to send a message to the server that stops both the web server as well as the python-socketio server (they are connected).\r\n\r\nI currently have this code:\r\n\r\n```\r\nimport socketio\r\nfrom aiohttp import web\r\n\r\nsio = socketio.AsyncServer(async_mode='aiohttp')\r\napp = web.Application()\r\nsio.attach(app)\r\n\r\nweb.run_app(app)\r\n\r\n@sio.on('quit tonalite', namespace='/tonalite')\r\nasync def quit_tonalite(sid, message):\r\n    sys.exit(0)\r\n```\r\n\r\n## Expected behaviour\r\n\r\nI would expect the script to close just as if I was clicking `CTRL+C` in the terminal.\r\n\r\n## Actual behaviour\r\n\r\nI get this error:\r\n\r\n```\r\nmessage async handler error\r\nTraceback (most recent call last):\r\n  File \"/home/johnroper100/.local/lib/python3.6/site-packages/engineio/asyncio_server.py\", line 266, in _trigger_event\r\n    ret = await self.handlers[event](*args)\r\n  File \"/home/johnroper100/.local/lib/python3.6/site-packages/socketio/asyncio_server.py\", line 364, in _handle_eio_message\r\n    await self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)\r\n  File \"/home/johnroper100/.local/lib/python3.6/site-packages/socketio/asyncio_server.py\", line 294, in _handle_event\r\n    await self._handle_event_internal(self, sid, data, namespace, id)\r\n  File \"/home/johnroper100/.local/lib/python3.6/site-packages/socketio/asyncio_server.py\", line 297, in _handle_event_internal\r\n    r = await server._trigger_event(data[0], namespace, sid, *data[1:])\r\n  File \"/home/johnroper100/.local/lib/python3.6/site-packages/socketio/asyncio_server.py\", line 325, in _trigger_event\r\n    ret = await self.handlers[namespace][event](*args)\r\n  File \"tonalite.py\", line 373, in quit_tonalite\r\n    sys.exit(0)\r\nSystemExit: 0\r\n```\r\n\r\n## Your environment\r\n\r\nI'm using aiohttp as a server on both Windows and Linux.\r\n"},"comment":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/comments/354624468","html_url":"https://github.com/aio-libs/aiohttp/issues/2637#issuecomment-354624468","issue_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2637","id":354624468,"user":{"login":"johnroper100","id":9782943,"avatar_url":"https://avatars3.githubusercontent.com/u/9782943?v=4","gravatar_id":"","url":"https://api.github.com/users/johnroper100","html_url":"https://github.com/johnroper100","followers_url":"https://api.github.com/users/johnroper100/followers","following_url":"https://api.github.com/users/johnroper100/following{/other_user}","gists_url":"https://api.github.com/users/johnroper100/gists{/gist_id}","starred_url":"https://api.github.com/users/johnroper100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnroper100/subscriptions","organizations_url":"https://api.github.com/users/johnroper100/orgs","repos_url":"https://api.github.com/users/johnroper100/repos","events_url":"https://api.github.com/users/johnroper100/events{/privacy}","received_events_url":"https://api.github.com/users/johnroper100/received_events","type":"User","site_admin":false},"created_at":"2017-12-31T21:26:19Z","updated_at":"2017-12-31T21:26:19Z","author_association":"NONE","body":"It's all in a repo here: https://github.com/johnroper100/Tonalite"}}
{"actor":{"display_login":"johnroper100"}}