code: @Override
  	public void run()
      {
          try
          {
          	if (pingInterval > 0)
          		ActivityWatchdog.getInstance().register(this);
          	
              while (!stopRequired)
              {
              	int actualMaxPacketSize = Integer.MAX_VALUE;
              	if (maxPacketSize != -1)
              		actualMaxPacketSize = trustedConnection ? maxPacketSize : 1024;
  
                  AbstractPacket packet = receive(actualMaxPacketSize);
                  if (packet == null)
                  {
                  	if (stopRequired)
                  		break;
                  	
                  	// Report connection closed
                      log.debug("#"+id+" connection closed by remote peer.");
                      transport.closeTransport(true);
                      break;
                  }
                  
                  if (traceEnabled)
                      log.trace("#"+id+" Received "+packet);
                  
                  lastActivity = System.currentTimeMillis();
                  if (listener != null)
                  	trustedConnection = listener.packetReceived(packet);
              }
          }
          catch (Exception e)
          {
              if (!stopRequired)
              {
              	log.error("#"+id+" transport failed : "+e.toString());
              	transport.closeTransport(true);
              }
          }
          catch (Throwable e)
          {
          	log.fatal("#"+id+" TCP packet receiver died",e);
          }
          
          log.debug("#"+id+" stopping.");
      }
docs: /* (non-Javadoc)
  @see java.lang.Thread#run()