private void accept(Socket socket){
  log.info("Client connected from {}",socket.getInetAddress());
  try {
    InetAddress serverAddress=dns.getAddress("gamea.clashofclans.com");
    try (Connection clientConnection=new Connection(socket);Connection serverConnection=new Connection(new Socket(serverAddress,CLASH_PORT))){
      ProxySession session=ProxySession.newSession(services.getMessageFactory(),clientConnection,serverConnection,filterChain);
      log.info("Client {} disconnected",socket);
      VillageAnalyzer.logSession(session);
    }
   }
 catch (  IOException e) {
    log.info("Could not proxy connection from {}: {}",socket.getInetAddress(),e.toString());
  }
 finally {
    try {
      socket.close();
    }
 catch (    IOException e) {
    }
  }
}

private void accept ( Socket socket ) { log . info ( "Client connected from {}" , socket . getInetAddress ( ) ) ; try { InetAddress serverAddress = dns . getAddress ( "gamea.clashofclans.com" ) ; try ( Connection clientConnection = new Connection ( socket ) ; Connection serverConnection = new Connection ( new Socket ( serverAddress , CLASH_PORT ) ) ) { ProxySession session = ProxySession . newSession ( services . getMessageFactory ( ) , clientConnection , serverConnection , filterChain ) ; log . info ( "Client {} disconnected" , socket ) ; VillageAnalyzer . logSession ( session ) ; } } catch ( IOException e ) { log . info ( "Could not proxy connection from {}: {}" , socket . getInetAddress ( ) , e . toString ( ) ) ; } finally { try { socket . close ( ) ; } catch ( IOException e ) { } } }
accept a connection from a client and proxy it to the server . will block until processing completes ( typically because the client closes its connection to us ) . < p > the socket and any associated streams will be closed before this call completes .
