Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"Everything is working great ! Very impressive client. The news refreshes better and is more pertinent than the ******* feed I paid $ 100/month for. I Also like the charts a lot." - Comment from Leon
"Excellent datafeed !!!" - Comment from Arely
"I'm very glad I switched to IQFeed. It's working perfectly with no lag, even during fast market conditions." - Comment from Andy via Email
"I'm satisfied with IQFeed. It's the most reliable and fastest quote feed I have ever used. Although I'm a resident in China, it's still very fast!" - Comment from Xiaofei
"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"IQ feed is brilliant. The support is mind-bending. What service!" - Comment from Public Forum Post
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"I am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"I like you guys better than *******...much more stable and a whole lot fewer issues." - Comment from Philip
"Its working FABULOUSLY for me!! Holy cow...there has been so much I've been missing lately, and with this feed and Linnsoft software...I'm in the game now." - Comment from Chris R.
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »Archive (2017 and earlier) »IQFeed Developer Support »BufferedReader.readLine hangs for history lookup
Author Topic: BufferedReader.readLine hangs for history lookup (3 messages, Page 1 of 1)

arth_trader
-Interested User-
Posts: 5
Joined: Apr 16, 2014


Posted: May 18, 2016 10:29 AM          Msg. 1 of 3
I am trying to get historical tick data using the Java API (IQFeed version 5.2.1). Here is the code snippet:

String command = "HTX,IBM,5,,testid,\r\n\n";
// String line;
C_LookupIQFeed_Socket.brBufferedWriter.write(command);
C_LookupIQFeed_Socket.brBufferedWriter.flush();

while ((line = C_LookupIQFeed_Socket.brBufferedReader.readLine()) != null) {
logger.debug("HistoryRecord={}", line);
}

It prints the output till the last record ("!ENDMSG!,"), but hangs at the readLine() thereafter i.e. the readLine() is never returning null after the last record. I have tested this on the samples provided, same thing happens. Any idea? Is it possible that the server is not sending a new line after the last message. Is there any other way to handle this?

Thanks.

DTN_Tim Walter
-DTN Guru-
Posts: 1238
Joined: Apr 25, 2006


Posted: May 18, 2016 12:39 PM          Msg. 2 of 3
Once the ENDMSG is received the data for that request has completed (a null is not sent), Just stop reading the socket at that time, at least until you have requested more data, and I think that will alleviate your issue.

Tim

arth_trader
-Interested User-
Posts: 5
Joined: Apr 16, 2014


Posted: May 19, 2016 01:33 PM          Msg. 3 of 3
Thanks Tim.
 

 

Time: Sun May 19, 2024 1:14 PM CFBB v1.2.0 6 ms.
© AderSoftware 2002-2003