public Server(boolean useEvent) {
    /**
     * Listener port 9090 and setup handler input calls
     */
    conn = new RemoteServerConnection(9090, new Helper());

    //conn.setIdleTimeout(idleTimeout);


    /**
     * Optional events
     */
    if (useEvent) {
      conn.addServerStartListener(new ServerStartListener() {
        public void OnServerStartEvent(ServerStartEvent evt) {
          System.out.println("ServerSocket is started.");
        }
      });

      conn.addServerStopListener(new ServerStopListener() {
        public void OnServerStopEvent(ServerStopEvent evt) {
          System.out.println("ServerSocket is stopped.");
        }
      });

      conn.addClientConnectListener(new ConnectOnServerListener() {
        public void OnClientConnectEvent(ConnectOnServerEvent evt) {
          System.out.println("Client from address: " + evt.getClientConnection().getRemoteAddress());
        }
      });

      conn.setAttemptClientConnect(new IAttemptClientConnect() {
        public boolean OnAttemptClientConnectEvent(AttemptClientConnectEvent evt) {
          if (evt.getSocketServerConnection().getRemoteIP().equalsIgnoreCase("192.168.10.10")) {
            return false;
          }
          return true;
        }
      });

      conn.addConnectionDisconnectListener(new ConnectionDisconnectListener() {
        public void OnConnectionDisconnectEvent(ConnectionDisconnectEvent evt) throws Exception {
          System.out.println("Client " + evt.getIdConnection() + " disconneted.");
        }
      });
    }
  }