Example #1
0
    def receive_message(self, operation, request_id):
        """Receive a raw BSON message or raise ConnectionFailure.

        If any exception is raised, the socket is closed.
        """
        try:
            return receive_message(self.sock, operation, request_id)
        except BaseException as error:
            self._raise_connection_failure(error)
Example #2
0
    def receive_message(self, operation, request_id):
        """Receive a raw BSON message or raise ConnectionFailure.

        If any exception is raised, the socket is closed.
        """
        try:
            return receive_message(self.sock, operation, request_id)
        except BaseException as error:
            self._raise_connection_failure(error)