|
@@ -272,7 +272,7 @@ class Server(object):
|
|
|
self.connection_handler = []
|
|
|
|
|
|
|
|
|
- atexit.register(self.sync_shutdown)
|
|
|
+ atexit.register(self.shutdown)
|
|
|
|
|
|
def make_socket(self):
|
|
|
"""
|
|
@@ -318,14 +318,14 @@ class Server(object):
|
|
|
self.socket.bind(self.host)
|
|
|
self.socket.listen(self.max_allowed_clients)
|
|
|
|
|
|
- def sync_shutdown(self):
|
|
|
+ def shutdown(self):
|
|
|
"""
|
|
|
this method can be called synchronous and calls the asynchronous
|
|
|
shutdown method.
|
|
|
"""
|
|
|
curio.run(self.shutdown)
|
|
|
|
|
|
- async def shutdown(self):
|
|
|
+ async def async_shutdown(self):
|
|
|
"""
|
|
|
This method properly shuts down the sockets and closes them.
|
|
|
it unregisters itself from atexit, so it doesn't get executed twice
|