code: def recv(self, nbytes):
          
          try:
              out = self.in_buffer.read(nbytes, self.timeout)
          except PipeTimeout, e:
              raise socket.timeout()
  
          ack = self._check_add_window(len(out))
          # no need to hold the channel lock when sending this
          if ack > 0:
              m = Message()
              m.add_byte(chr(MSG_CHANNEL_WINDOW_ADJUST))
              m.add_int(self.remote_chanid)
              m.add_int(ack)
              self.transport._send_user_message(m)
  
          return out
docs: Receive data from the channel.  The return value is a string
          representing the data received.  The maximum amount of data to be
          received at once is specified by C{nbytes}.  If a string of length zero
          is returned, the channel stream has closed.
  
          @param nbytes: maximum number of bytes to read.
          @type nbytes: int
          @return: data.
          @rtype: str
          
          @raise socket.timeout: if no data is ready before the timeout set by
              L{settimeout}.