if ( pendingpeers != null )
if ( pendingPeers != null )
  public void LoopOnce()  {    if ( floods != null )    {      Collection floodsToProcess = floods.values();      Iterator floodIter = floodsToProcess.iterator();      while ( floodIter.hasNext() )      {        Flood flood = (Flood) floodIter.next();        flood.LoopOnce();      }    }    if ( pendingpeers != null )    {      Enumeration peeriter = pendingpeers.elements();      for ( ; peeriter.hasMoreElements(); )      {        PeerConnection peer = (PeerConnection) peeriter.nextElement();        peer.LoopOnce();      }    }    if ( listenSocketSelector != null )    {      try      {        listenSocketSelector.selectNow();      }      catch ( Exception e )      {        System.out.println( "Error selecing from listenSocketSelector: " + e );      }      // if the socket can accept, test for an incoming connection      // Get list of selection keys with pending events      Iterator it = listenSocketSelector.selectedKeys().iterator();      while ( it.hasNext() )      {        // Get the selection key        SelectionKey selKey = (SelectionKey) it.next();        // Remove it from the list to indicate that it is being processed        it.remove();        // Check if it's a connection request        if ( selKey.isAcceptable() )        {          int tmp = listenSocketChannel.socket().getLocalPort();          SocketChannel incomingSocket = null;          try          {            incomingSocket = listenSocketChannel.accept();          }          catch ( Exception e )          {            System.out.println( "Error accepting connection from listenSocketChannel: " + e );          }          if ( incomingSocket != null )          {            PeerConnection incomingPeer = new PeerConnection( incomingSocket );            pendingpeers.add( incomingPeer );          }        }      }    }  }