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)




"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from Public Forum
"I just wanted to tell you what a fine job you have been doing. While *******, from what I hear, has been down and out, off and on, IQ feed has held like a champ this week." - Comment from Shirin
"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
"Everything is working amazing now. I'm already impressed with the true-tick feed of IQFeed and it's ability to support my 480 symbol layout." - Comment from Tyler via Email
"I had always used ******* but for the past 2 weeks have been trying DTN IQFeed. Customer support has been extraordinary. They call just to make sure your problem hasn't recurred." - Comment from Public Forum
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"I am enjoying the feed very much - so superior to the broker provided feed I was previously using." - Comment from George
"If you are serious about your trading I would not rely on IB data for serious daytrading. Took me a while to justify the cost of IQ Feed and in the end, it's just a 2 point stop on ES. Better safe than sorry" - Comment from Public Forum
"DTN feed was the only feed that consistently matched Bloomberg feed for BID/ASK data verification work these past years......DTN feed is a must for my supply & demand based trading using Cumulative Delta" - Comment from Public Forum Post
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 »basic socket question
Author Topic: basic socket question (2 messages, Page 1 of 1)

jpaladin
-Interested User-
Posts: 2
Joined: Jan 30, 2008


Posted: Feb 2, 2008 09:36 AM          Msg. 1 of 2
I am new to sockets, and figuring out this sample application code :

while (true ) {

line = in.readLine();

sout.write(line+"\r\n");
sout.flush();

if (line.trim().equals("x") ) {break;}

}

So, why does in.readLine() block, and what could it possibly be waiting for ?
Setting a break point after in.readLine() it never hits.
I guess socket code blocks by default when you tell it to read, and it is empty ?

I see that "in" is a System.in socket, so I guess it is some kind of global server socket.

When it gets something, it is reflected to the IQFeed socked that I watch for my data, so I would like to know what I might have to deal with while watching the data.

if an "x" arrives my whole feed is going to be shutdown.

So, I would like to better understand this code.

Joe paladin

JDonovan
-Interested User-
Posts: 24
Joined: Feb 11, 2007


Posted: Feb 5, 2008 07:40 AM          Msg. 2 of 2
Windows sockets block by default....it's waiting for data to arrive. You can easilly set the sockets to non-blocking, suggest digging into some socket documentation/reading if you want to go much further.

- Jeff
 

 

Time: Mon May 6, 2024 3:41 AM CFBB v1.2.0 11 ms.
© AderSoftware 2002-2003