b.s.s.SmartTCPServer(object) : class documentation

Part of bzrlib.smart.server View In Hierarchy

Known subclasses: bzrlib.tests.test_server.TestingSmartServer

Listens on a TCP socket and accepts connections from smart clients.

Each connection will be served by a SmartServerSocketStreamMedium running in a thread.

hooks: An instance of SmartServerHooks.

Method __init__ Construct a new server.
Method start_server Create the server listening socket.
Method run_server_started_hooks Undocumented
Method run_server_stopped_hooks Undocumented
Method serve Undocumented
Method get_url Return the url of the server
Method serve_conn Undocumented
Method start_background_thread Undocumented
Method stop_background_thread Undocumented
Method _backing_urls Undocumented
Method _stop_gracefully Undocumented
Method _wait_for_clients_to_disconnect Undocumented
Method _make_handler Undocumented
Method _poll_active_connections Check to see if any active connections have finished.
def __init__(self, backing_transport, root_client_path='/', client_timeout=None):
Construct a new server.

To actually start it running, call either start_background_thread or serve.

Parametersbacking_transportThe transport to serve.
root_client_pathThe client path that will correspond to root of backing_transport.
client_timeoutSee SmartServerSocketStreamMedium's timeout parameter.
def start_server(self, host, port):
Create the server listening socket.
ParametershostName of the interface to listen on.
portTCP port to listen on, or 0 to allocate a transient port.
def _backing_urls(self):
Undocumented
def run_server_started_hooks(self, backing_urls=None):
Undocumented
def run_server_stopped_hooks(self, backing_urls=None):
Undocumented
def _stop_gracefully(self):
Undocumented
def _wait_for_clients_to_disconnect(self):
Undocumented
def serve(self, thread_name_suffix=''):
Undocumented
def get_url(self):
Return the url of the server
def _make_handler(self, conn):
Undocumented
def _poll_active_connections(self, timeout=0.0):
Check to see if any active connections have finished.

This will iterate through self._active_connections, and update any connections that are finished.

ParameterstimeoutThe timeout to pass to thread.join(). By default, we set it to 0, so that we don't hang if threads are not done yet.
ReturnsNone
def serve_conn(self, conn, thread_name_suffix):
Undocumented
def start_background_thread(self, thread_name_suffix=''):
Undocumented
def stop_background_thread(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.