Requests will be queued if connection process is not yet completed. So, no need to wait for onLogin() event. However, if login attempt fails, all requests will receive error completion status. In your listing, processing will block at "request.waitForCompletion()" waiting for the login and request completion.
-Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mike
I have a question regarding otfeed example HistTick.java
How do you know that connection is actually initialized when you make the request?
Should you actually wait that OnLogin returns before you can actually call prepareRequest?
Thank you
IConnection connection = Connector.connect();
try {
IRequest request = connection.prepareRequest(command);
request.submit();
request.waitForCompletion();
} finally {
connection.shutdown();
connection.waitForCompletion();
}
Requests will be queued if connection process is not yet completed. So, no need to wait for onLogin() event. However, if login attempt fails, all requests will receive error completion status. In your listing, processing will block at "request.waitForCompletion()" waiting for the login and request completion.
-Mike