'Send a getmore message and handle the response.'

def __send_message(self, operation):

    client = self.__collection.database.client
    listeners = client._event_listeners
    publish = listeners.enabled_for_commands
    try:
        response = client._send_message_with_response(operation, address=self.__address)
    except AutoReconnect:
        self.__killed = True
        raise
    cmd_duration = response.duration
    rqst_id = response.request_id
    from_command = response.from_command
    if publish:
        start = datetime.datetime.now()
    try:
        doc = helpers._unpack_response(response.data, self.__id, self.__collection.codec_options)
        if from_command:
            helpers._check_command_response(doc['data'][0])
    except OperationFailure as exc:
        self.__killed = True
        if publish:
            duration = ((datetime.datetime.now() - start) + cmd_duration)
            listeners.publish_command_failure(duration, exc.details, 'getMore', rqst_id, self.__address)
        raise
    except NotMasterError as exc:
        self.__killed = True
        if publish:
            duration = ((datetime.datetime.now() - start) + cmd_duration)
            listeners.publish_command_failure(duration, exc.details, 'getMore', rqst_id, self.__address)
        client._reset_server_and_request_check(self.address)
        raise
    except Exception as exc:
        if publish:
            duration = ((datetime.datetime.now() - start) + cmd_duration)
            listeners.publish_command_failure(duration, _convert_exception(exc), 'getMore', rqst_id, self.__address)
        raise
    if from_command:
        cursor = doc['data'][0]['cursor']
        documents = cursor['nextBatch']
        self.__id = cursor['id']
        self.__retrieved += len(documents)
    else:
        documents = doc['data']
        self.__id = doc['cursor_id']
        self.__retrieved += doc['number_returned']
    if publish:
        duration = ((datetime.datetime.now() - start) + cmd_duration)
        res = {'cursor': {'id': self.__id, 'ns': self.__collection.full_name, 'nextBatch': documents}, 'ok': 1}
        listeners.publish_command_success(duration, res, 'getMore', rqst_id, self.__address)
    if (self.__id == 0):
        self.__killed = True
    self.__data = deque(documents)
