Пример #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());
    }
  }
Пример #2
0
 @Override
 public void error(Exception e) {
   LogUtil.log("EXCEPTION thrown by TWS API: " + e.getMessage());
   // TODO
   System.out.println("EXCEPTION thrown by TWS API: " + e.getMessage());
 }