} else {
socket = new Socket(uri.getHost(), uri.getPort());
}
socket.setTcpNoDelay(true);
Client.fireEvent(new ConnectionOpened(uri));
} catch (ConnectException e) {
throw new IOException("Cannot connect to server '" + uri.toString() + "'. Check that the server is started and that the specified serverURL is correct.", e);
} catch (IOException e) {
throw new IOException("Cannot connect to server: '" + uri.toString() + "'. Exception: " + e.getClass().getName() + " : " + e.getMessage(), e);