JGN.createThread(syncManager).start();
//connect to the server
System.out.println("Connecting...");
try {
client.connectAndWait(serverReliable, serverFast, 5000);
} catch (IOException e) {
//Show an error message that we couldn't connect and print detailed info to standard error
JOptionPane.showMessageDialog(null, "Could not connect to server.", "Connection Error", JOptionPane.ERROR_MESSAGE);
System.err.println("Error while connecting to server:");
e.printStackTrace();