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
"I like you guys better than *******...much more stable and a whole lot fewer issues." - Comment from Philip
"I was with ******* for 4 years at $230 a month, this is a huge savings for me, GOD BLESS YOU PEOPLE," - Comment from T.S. via Email
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"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
"It’s so nice to be working with real professionals!" - Comment from Len
"I have been using IQFeed now for a few years in MultiCharts and I have zero complaints. Very, very rare to have any data hiccups or anything at all go wrong." - 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
"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
"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
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 1045 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: Thu May 9, 2024 4:34 PM CFBB v1.2.0 14 ms.
© AderSoftware 2002-2003