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

Part of bzrlib.smart.medium View In Hierarchy

No class docstring
Method __init__ Construct new server.
Method serve See SmartServerStreamMedium.serve
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 _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, in_file, out_file, backing_transport, timeout=None):
Construct new server.
Parametersin_filePython file from which requests can be read.
out_filePython file to write responses.
backing_transportTransport for the directory served.
def serve(self):
See SmartServerStreamMedium.serve
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 2022-06-16 00:25:16.