I suppose asyncio lack async version of sock_close that can call loop.remove_reader and others before close socket and perhaps lack something like coroutine AbstractEventLoop.sock_make_blocking that can do some deregister job. switch constant in the script: * change CALL_REMOVE_READING_BEFORE_CLOSE to True will make script running smoothly * change USE_UVLOOP to True will make script use uvloop