if(args.length % 4 != 0 || args.length == 0) { log.error("\nLogicalLink <link+>\nwhere <link> is " + "<local host> <local port> <remote host> <remote port>\n"); return; }  while(i < args.length) { local_host=args[i++]; local_port=Integer.parseInt(args[i++]); remote_host=args[i++]; remote_port=Integer.parseInt(args[i++]); ll.addLink(local_host, local_port, remote_host, remote_port); }  try { ll.start(); } catch(Exception e) { log.error("LogicalLink.main(): " + e); }  BufferedReader in= new BufferedReader(new InputStreamReader(System.in)); while(true) { try { System.out.print("> "); System.out.flush(); String line=in.readLine(); ll.send(line.getBytes()); } catch(Exception e) { log.error(e); } }
if(args.length % 4 != 0 || args.length == 0) { System.err.println("\nLogicalLink <link+>\nwhere <link> is " + "<local host> <local port> <remote host> <remote port>\n"); return; }  while(i < args.length) { local_host=args[i++]; local_port=Integer.parseInt(args[i++]); remote_host=args[i++]; remote_port=Integer.parseInt(args[i++]); ll.addLink(local_host, local_port, remote_host, remote_port); }  try { ll.start(); } catch(Exception e) { System.err.println("LogicalLink.main(): " + e); }  BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); while(true) { try { System.out.print("> "); System.out.flush(); String line=in.readLine(); ll.send(line.getBytes()); } catch(Exception e) { System.err.println(e); } }
    public static void main(String[] args) {	LogicalLink ll=new LogicalLink();	String      local_host, remote_host;	int         local_port, remote_port;	int         i=0;	ll.setReceiver(new MyReceiver());	if(args.length % 4 != 0 || args.length == 0) {	    log.error("\nLogicalLink <link+>\nwhere <link> is " +			       "<local host> <local port> <remote host> <remote port>\n");	    return;	}		while(i < args.length) {	    local_host=args[i++];	    local_port=Integer.parseInt(args[i++]);	    remote_host=args[i++];	    remote_port=Integer.parseInt(args[i++]);	    ll.addLink(local_host, local_port, remote_host, remote_port);	}		try {	    ll.start();	}	catch(Exception e) {	    log.error("LogicalLink.main(): " + e);	}		BufferedReader in= new BufferedReader(new InputStreamReader(System.in));	    	while(true) {	    try {		System.out.print("> "); System.out.flush();		String line=in.readLine();		ll.send(line.getBytes());	    }	    catch(Exception e) {		log.error(e);	    }	}	    }