if (av.length >= 1)
host = av[0];
else
host = "localhost";
if (av.length >= 2)
portNum = Integer.parseInt(av[1]);
else portNum = 23;
System.out.println("Host " + host + "; port " + portNum);
try {
Socket s = new Socket(host, portNum);
// Connect the remote to our stdout
new Pipe(s.getInputStream(), System.out).start();
// Connect our stdin to the remote
new Pipe(System.in, s.getOutputStream()).start();
} catch(IOException e) {
System.out.println(e);
return;
}
System.out.println("Connected OK");