'Stops listening and accepting connection requests. All live
connections are closed.
This method can safely be called by another thread.'

def shutdown(self):

    logger.info(u'Callback    Server    Shutting    Down')
    with self.lock:
        self.is_shutdown = True
        quiet_shutdown(self.server_socket)
        quiet_close(self.server_socket)
        self.server_socket = None
        for connection in self.connections:
            quiet_shutdown(connection.socket)
            quiet_close(connection.socket)
        self.pool.clear()
    self.thread.join()
    self.thread = None
