// Create the client by creating its reader and writer threads
// and starting them.
try {
socket = new Socket(host, port);
// Create reader and writer sockets
reader = new Reader(this);
writer = new Writer(this);
// Give the reader a higher priority to work around
// a problem with shared access to the console.
reader.setPriority(6);
writer.setPriority(5);
// Start the threads
reader.start();
writer.start();
}
catch (IOException e) { System.err.println(e); }