b.s.m.SmartServerSocketStreamMedium(SmartServerStreamMedium) : class documentation

Part of bzrlib.smart.medium View In Hierarchy

Known subclasses: bzrlib.tests.test_server.TestingSmartConnectionHandler

No class docstring
Method __init__ Constructor.
Method __str__ Undocumented
Method __repr__ Undocumented
Method terminate_due_to_error Called when an unhandled exception from the protocol occurs.
Method _serve_one_request_unguarded Undocumented
Method _disconnect_client Close the current connection. We stopped due to a timeout/etc.
Method _wait_for_bytes_with_timeout Wait for more bytes to be read, but timeout if none available.
Method _read_bytes Get some bytes from the medium.
Method _write_out Undocumented

Inherited from SmartServerStreamMedium:

Method serve Serve requests until the client disconnects.
Method _stop_gracefully When we finish this message, stop looking for more.
Method _build_protocol Identifies the version of the incoming request, and returns an
Method _wait_on_descriptor select() on a file descriptor, waiting for nonblocking read()
Method _serve_one_request Read one request from input, process, send back a response.

Inherited from SmartMedium (via SmartServerStreamMedium):

Method read_bytes Read some bytes from this medium.
Method _push_back Return unused bytes to the medium, because they belong to the next
Method _get_push_back_buffer Undocumented
Method _get_line Read bytes from this request's response until a newline byte.
Method _report_activity Notify that this medium has activity.
def __init__(self, sock, backing_transport, root_client_path='/', timeout=None):
Constructor.
Parameterssockthe socket the server will read from. It will be put into blocking mode.
def __str__(self):
Undocumented
def __repr__(self):
Undocumented
def _serve_one_request_unguarded(self, protocol):
Undocumented
def _disconnect_client(self):
Close the current connection. We stopped due to a timeout/etc.
def _wait_for_bytes_with_timeout(self, timeout_seconds):
Wait for more bytes to be read, but timeout if none available.

This allows us to detect idle connections, and stop trying to read from them, without setting the socket itself to non-blocking. This also allows us to specify when we watch for idle timeouts.

ReturnsNone, this will raise ConnectionTimeout if we time out before data is available.
def _read_bytes(self, desired_count):
Get some bytes from the medium.
Parametersdesired_countnumber of bytes we want to read.
def terminate_due_to_error(self):
Called when an unhandled exception from the protocol occurs.
def _write_out(self, bytes):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2019-09-23 00:31:07.