'Get the next stanza that has been received.
Arguments:
timeout -- Optional timeout for waiting for a new value.'

def next_recv(self, timeout=None):

    args = {'block': False}
    if (timeout is not None):
        args = {'block': True, 'timeout': timeout}
    try:
        if self.recv_buffer:
            return self.recv_buffer.pop(0)
        else:
            return self.recv_queue.get(**args)
    except:
        return None
