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)




"There is no doubt that IQFeed is the best data provider. I am very satisfied with your services. And IQFeed is the only one that I would recommend to my friends. Now, most of them are using your product in China." - Comment from Zhezhe
"Just a quick one to say I'm very impressed so far :) The documentation for developers is excellent and I've quickly managed to get an app written to do historical downloads. The system is very robust and pretty quick considering the extent of data that's available. The support guys have been very helpful too, in combination with the forums it's been plain sailing so far!" - Comment from Adam
"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 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
"The people at Nirvana have very nice things to say about your company and I can see why! Price and service is a potent combination." - Comment from Ed
"I am keeping IQFeed, much better reliabilty than *******. I may refer a few other people in the office to switch as well." - Comment from Don
"I would just like to say that IQFeed version 4 is running very well and I am very happy with its performance. I would also like to extend a big thanks for the fast and efficient help that I always receive. My questions and concerns are always addressed promptly. Way to go!" - Comment from Josh in CO.
"I am very happy I changed. I love the product, but more so I am thrilled with Tech Support. You are knowledgeable, polite, pleasant and professional." - Comment from Pat
"I used to have *******, but they are way more money for the same thing. I have had no probs with data from DTN since switching over." - Comment from Public Forum Post
"I will tell others who want to go into trading that DTN ProphetX is an invaluable tool, I don't think anyone can trade without it..." - Comment from Luther
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 »java connection leak
Author Topic: java connection leak (6 messages, Page 1 of 1)

rkamaly
-Interested User-
Posts: 6
Joined: Aug 10, 2014


Posted: Aug 12, 2014 12:02 AM          Msg. 1 of 6
Hi,

I am currently using java to connect to iqfeed to retrieve historical data. Am using multiple threads to fetch a HTT request. Each thread creates a Feed object whose life cycle looks like this

public void open() throws IOException {
this.socket = new Socket(InetAddress.getByName(FEED_HOST), FEED_PORT);
this.socketReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
this.socketWriter = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
}

public void close() throws IOException {
this.socket.shutdownOutput();
this.socket.shutdownInput();
this.socket.close();
this.socketReader.close();
this.socketWriter.close();
LOGGER.debug("closing connection");
}


After running the process for about 10 symbols and their related option chain, the code just balks. Upon inspection of the feed client ui, it indeed does say there are some connections open. These connections still appear to be active, after the java proc is killed.

Strangeness ensues, when I try to kill the iqconnect.exe from the tray. It looks like it's gone, but is still visible in the windows task manager tab. After I kill it from there, I am able to rerun the historical data pull.

Please advice on how to resolve this.

Thanks!

rkamaly
-Interested User-
Posts: 6
Joined: Aug 10, 2014


Posted: Aug 12, 2014 09:34 AM          Msg. 2 of 6
Btw, am using 20 threads simultaneously, whilst opening and closing em for every HTT request

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


Posted: Aug 12, 2014 09:47 AM          Msg. 3 of 6
Good morning,

We do have a limit of 15 concurrent connections, but generally a loop of 20 or so works out just fine, and since you are not even getting that far into your loop, it seems unrelated. Have you enabled logging of the data being returned to IQ and compared that to what you are reading off of your sockets. I would guess clues as to where your problem lies could be found there.

But, if your issues persist, just shoot me some more code, especially where you are reading the data off of the socket to our developer email and I would be happy to take a look at it to see if something jumps out at me.

Tim

rkamaly
-Interested User-
Posts: 6
Joined: Aug 10, 2014


Posted: Aug 12, 2014 01:16 PM          Msg. 4 of 6
Hi Tim,

Thank you for your prompt response. I have changed the number of open connections to 3 now and am still facing these issues.

Have send out an email with the relevant java code packages attached.


Thanks for the assistance again.

^_^

rkamaly
-Interested User-
Posts: 6
Joined: Aug 10, 2014


Posted: Aug 12, 2014 01:21 PM          Msg. 5 of 6
Attaching the client status window for further information.

Also if I were to exit the client from the system tray. The process still lingers on, and I have to kill it with task manager.



File Attached: client window.png (downloaded 1044 times)

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


Posted: Aug 12, 2014 03:01 PM          Msg. 6 of 6
We are still investigating this matter, but for anyone else that might be interested, what appears to be happening here involves the fact that when data is received in the socket, there is no guarantee that the entire return will fit in one message. So when reading from the socket, if you have not yet read in the terminating string of the message, you will want to store off any partial message that is left in your buffer, and prepend that to the next message. You can continue this until the terminating string is received to be sure you have all of your data.

As I mentioned, this is still under investigation, but for anyone that was curious or having similar issues, that is where we are currently.

Tim
 

 

Time: Sun May 5, 2024 5:31 AM CFBB v1.2.0 14 ms.
© AderSoftware 2002-2003