code: def socket_recv(self):
          
          try:
              data = self.sock.recv(2048)
          except socket.error, ex:
              print ("?? socket.recv() error '%d:%s' from %s" %
                  (ex[0], ex[1], self.addrport()))
              raise BogConnectionLost()
  
          ## Did they close the connection?
          size = len(data)
          if size == 0:
              raise BogConnectionLost()
  
          ## Update some trackers
          self.last_input_time = time.time()
          self.bytes_received += size
  
          ## Test for telnet commands
          for byte in data:
              self._iac_sniffer(byte)
  
          ## Look for newline characters to get whole lines from the buffer
          while True:
              mark = self.recv_buffer.find('\n')
              if mark == -1:
                  break
              cmd = self.recv_buffer[:mark].strip()
              self.command_list.append(cmd)
              self.cmd_ready = True
              self.recv_buffer = self.recv_buffer[mark+1:]
docs: Called by TelnetServer when recv data is ready.