Quote: Will the !ENDMSG! tag always be sent back - regardless of whether the history request was valid/invalid or completed successfully/unsuccessfully?
This issue has been a recurring one for me too. I do have time-outs, or did have until I discovered another anomaly the knowledge of which may help others.
There are times that the return data comes back much delayed. If you have a time out and do a re-request there is a very good chance that you will see some 'interesting' data -
IQConnect will return all requests interleaved if you use the same socket for the requests.
This behavior has caused me to waste a lot of tem in debugging an overnight backfill of historical data - I schedule an update around 3:OAK if the program runs overnight. (in an attempt to minimize server load) In my case, I did not do a re-request if no response for a request, but went to the next issue that needed historical data updates. Once one issue got out of the queue, then almost all of the subsequent retrievals came back with the data interleaved. Not a pretty picture... and not a systematic one so took a long time to catch the problem.
While I have not proven to myself that ENDMSG does not come back at all times, I am highly suspicious that it does not. I do not think IQConnect is 'smart' enough to make sure that the loop is closed for requests that are supposed to return data in some form.
Three issues here:1.0 There is no confirmation from the client that a request has occurred. This is true for all requests except for the initial login sequence which has the appearance of a dialog There is not an abort or time-out message from the client if there is a time-out of the data server-side, unless one gets the 'data not available' with the first query. (that does comes back fast)
2.0 In the returned historical data, there is no ID in the data identifying it with the request. I have no issues with interleaved data as long as each record has an ID. It does not have to be the stock symbol, a simple token would be fine, maybe one that is embedded in the request so that the caller can track his own entries.
3.0 Historical data should come back in a serial sequence - if there happens to be a second requests that get sent before the first finishes the data for it should queue and follow the first (for the same port)
David
IQXP Software
http://www.iqxp.com
LiveWire Update Service
PO Box 1417
Fairfield, IA 52556
641-472-8393
http://www.livewire-cablesoft.com/