'recvn(numb, timeout = default) -> str
Receives exactly `n` bytes.
If the request is not satisfied before ``timeout`` seconds pass,
all data is buffered and an empty string (``\'\'``) is returned.
Raises:
exceptions.EOFError: The connection closed before the request could be satisfied
Returns:
A string containing bytes received from the socket,
or ``\'\'`` if a timeout occurred while waiting.
Examples:
>>> t = tube()
>>> data = \'hello world\'
>>> t.recv_raw = lambda *a: data
>>> t.recvn(len(data)) == data
True
>>> t.recvn(len(data)+1) == data + data[0]
True
>>> t.recv_raw = lambda *a: None
>>> # The remaining data is buffered
>>> t.recv() == data[1:]
True
>>> t.recv_raw = lambda *a: time.sleep(0.01) or \'a\'
>>> t.recvn(10, timeout=0.05)
>>> t.recvn(10, timeout=0.06) # doctest: +ELLIPSIS
\'aaaaaa...\''

def recvn(self, numb, timeout=default):

    with self.countdown(timeout):
        while (self.countdown_active() and (len(self.buffer) < numb) and self._fillbuffer(self.timeout)):
            pass
    if (len(self.buffer) < numb):
        return ''
    return self.buffer.get(numb)
