class Connection {

  public void open() throws ConnectionException {
    if (!isConnected()) {
      try {
        socket = createSocket();
        socket.setReuseAddress(true);
        // Monitor TCP connection.
        socket.setKeepAlive(true);
        // Make sure packets arrive timely.
        socket.setTcpNoDelay(true);
        socket.setSoLinger(true, 0);

        socket.connect(getInetSocketAddress(), timeout);
        socket.setSoTimeout(socketTimeout);
      } catch (IOException ex) {
        throw new ConnectionException(ex);
      }
    }
  }

  public  Connection();
  public  Connection(final String host);
  public  Connection(final String host, final int port);
  public  Connection(final String host, final int port, final int timeout, final int socketTimeout);

}