code: def recv(self, bufsize):
      
      assert bufsize > 0, 'a positive bufsize is required'
  
      if len(self._buffer) < bufsize:
        readable, _, _ = safe_select([self._socket], [], [], self._select_timeout)
        if readable:
          recvd = self._socket.recv(max(self._chunk_size, bufsize))
          self._buffer = self._buffer + recvd
      return_buf, self._buffer = self._buffer[:bufsize], self._buffer[bufsize:]
      return return_buf
docs: Buffers up to _chunk_size bytes when the internal buffer has less than `bufsize` bytes.