'Read up to size bytes, blocking until one byte is read.'

def recv(self, size):

    buf_len = self._buf_len()
    if buf_len:
        data = self._rbuf.read(size)
        if (size >= buf_len):
            self._rbuf = BytesIO()
        return data
    return self._read(self.read_some, size)
