private void initConnection() throws ReplicatorException {
  try {
    logger.info("Connecting to the filtering server on port " + serverPort);
    InetAddress host=InetAddress.getByName("localhost");
    socket=new Socket(host,serverPort);
    socket.setSoTimeout(timeout * 1000);
    logger.debug("Receive buffer size: " + socket.getReceiveBufferSize());
    logger.info("Connected to " + socket.getRemoteSocketAddress());
    toServer=new PrintWriter(socket.getOutputStream(),true);
    fromServer=new BufferedReader(new InputStreamReader(socket.getInputStream()));
  }
 catch (  UnknownHostException e) {
    throw new ReplicatorException("Unable to connect to filtering server: " + e,e);
  }
catch (  IOException e) {
    throw new ReplicatorException("Unable to connect to filtering server: " + e,e);
  }
}

private void initConnection ( ) throws ReplicatorException { try { logger . info ( "Connecting to the filtering server on port " + serverPort ) ; InetAddress host = InetAddress . getByName ( "localhost" ) ; socket = new Socket ( host , serverPort ) ; socket . setSoTimeout ( timeout * 1000 ) ; logger . debug ( "Receive buffer size: " + socket . getReceiveBufferSize ( ) ) ; logger . info ( "Connected to " + socket . getRemoteSocketAddress ( ) ) ; toServer = new PrintWriter ( socket . getOutputStream ( ) , true ) ; fromServer = new BufferedReader ( new InputStreamReader ( socket . getInputStream ( ) ) ) ; } catch ( UnknownHostException e ) { throw new ReplicatorException ( "Unable to connect to filtering server: " + e , e ) ; } catch ( IOException e ) { throw new ReplicatorException ( "Unable to connect to filtering server: " + e , e ) ; } }
connects to the filtering server and prepares i / o streams .
