'Receive a raw BSON message or raise ConnectionFailure.
If any exception is raised, the socket is closed.'

def receive_message(self, operation, request_id):

    try:
        return receive_message(self.sock, operation, request_id, self.max_message_size)
    except BaseException as error:
        self._raise_connection_failure(error)
