String hostname = "localhost";
int port = DEFAULT_PORT;
if (args.length > 0) {
hostname = args[0];
}
try {
InetAddress ia = InetAddress.getByName(hostname);
Thread sender = new SenderThread(ia, DEFAULT_PORT);
sender.start();
Thread receiver = new ReceiverThread(sender.getSocket());
receiver.start();
}
catch (UnknownHostException ex) {
System.err.println(ex);
}
catch (SocketException ex) {
System.err.println(ex);
}