b.t.t.TestingTCPServerMixin(object) : class documentation

Part of bzrlib.tests.test_server View In Hierarchy

Known subclasses: bzrlib.tests.test_server.TestingTCPServer, bzrlib.tests.test_server.TestingThreadingTCPServer

Mixin to support running SocketServer.TCPServer in a thread.

Tests are connecting from the main thread, the server has to be run in a separate thread.

Method __init__ Undocumented
Method server_bind Undocumented
Method serve Undocumented
Method handle_request Handle one request.
Method get_request Undocumented
Method verify_request Verify the request.
Method handle_error Undocumented
Method ignored_exceptions_during_shutdown Undocumented
Method stop_client_connections Undocumented
Method shutdown_socket Properly shutdown a socket.
Method set_ignored_exceptions Undocumented
Method _pending_exception Raise server uncaught exception.
def __init__(self):
Undocumented
def server_bind(self):
Undocumented
def serve(self):
Undocumented
def handle_request(self):
Handle one request.

The python version swallows some socket exceptions and we don't use timeout, so we override it to better control the server behavior.

def get_request(self):
Undocumented
def verify_request(self, request, client_address):
Verify the request.

Return True if we should proceed with this request, False if we should not even touch a single byte in the socket ! This is useful when we stop the server with a dummy last connection.

def handle_error(self, request, client_address):
Undocumented
def ignored_exceptions_during_shutdown(self, e):
Undocumented
def stop_client_connections(self):
Undocumented
def shutdown_socket(self, sock):
Properly shutdown a socket.

This should be called only when no other thread is trying to use the socket.

def set_ignored_exceptions(self, thread, ignored_exceptions):
Undocumented
def _pending_exception(self, thread):
Raise server uncaught exception.

Daughter classes can override this if they use daughter threads.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.