Example #1
0
  protected void connect() {
    client.eConnect(ip_add, return_port, return_clientId);

    try {
      while (!client.isConnected()) ;
      q.offer(
          "Connected to TWS server version "
              + client.serverVersion()
              + " at "
              + client.TwsConnectionTime());
    } catch (Exception e) {
      q.offer("EXCEPTION while connecting: " + e.getMessage());
    }
  }
Example #2
0
 protected boolean check_connection() {
   return client.isConnected();
 }
Example #3
0
 public void disconnect() {
   if (clientSocket.isConnected()) {
     clientSocket.eDisconnect();
     connected = false;
   }
 }