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)




"This is an excellent value, the system is generous (allowing for 500 stocks) and stable (and really is tick-by-tick), and the support is fantastic." - Comment from Shirin via Email
"Thanks for following up with me. You guys do a great job in tech support." - Comment from Phelps
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"I've been using IQFeed 4 in a multi-threaded situation for the last week or two on 2600 symbols or so with 100 simultaneous daily charts, and I have had 100% responsiveness." - Comment from Scott
"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
"I just wanted to let u know that your data feed/service is by far the best!!! Your unfiltered tick data is excellent for reading order flow and none of your competitors delivers this quality of data!" - Comment from Peter via Email
"I just wanted to say how happy I am with your service. I was able to download the API docs last week and I was able to replicate Interactive Brokers historical bar queries and realtime bar queries over the weekend. That was about one of the fastest integrations that I've ever done and it works perfectly!!!!" - Comment from Jason via Email
"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
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"Just a thank you for the very helpful and prompt assistance and services. You provided me with noticeably superior service in my setup compared to a couple of other options I had looked at." - Comment from John
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: Fri May 17, 2024 6:58 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003