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 ran your IQFeed DDE vs. my broker vs. a level II window for some slow-moving options. I would see the level II quote change, then your feed update instantaneously. My broker's DDE, however, would take as much as 30 seconds to update. I am not chasing milliseconds, but half a minute is unacceptable." - Comment from Rob
"This beats the pants off CQG, I am definitely switching to the ProphetX 3.0!" - Comment from Stephen
"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
"You are much better than lawyers or the phone company because you answer the phone when I call! I just love your customer service." - Comment from Isreal
"You are either overstaffed or people just don't have problems with your feed because customer support always answers the phone quickly." - Comment from Jay via Email
"Everything is working great with the API. I love it." - Comment from Calvin
"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
"IQ feed is brilliant. The support is mind-bending. What service!" - Comment from Public Forum Post
"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
"You have an excellent product !!!!!!" - Comment from Arely
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 RemoveClientApp() call not working in 4.1.2.0
Author Topic: Java RemoveClientApp() call not working in 4.1.2.0 (4 messages, Page 1 of 1)

simon33
-Interested User-
Posts: 28
Joined: Apr 9, 2005


Posted: Nov 8, 2006 12:34 PM          Msg. 1 of 4
Just upgraded my code from version 2.x to the IQFeed Developer, version 4.1.2.0. and the RemoveClientApp() method fails to close the DTN App. I'm concerned, since this used to work.

I am connecting from Java using the TCP/IP method (code will follow). I use the RegisterClientApp() and then get a new socket. On disconnect, I call the RemoveClientApp() method. In the past calling RemoveClientApp() closed the socket the the DTNApp in the system tray. The new version does close the socket, but does not close the App.

The issue comes up when either I lose a connection to DTN, or when I automatically start and stop the Connection. If you attempt a reconnect with the disconnected DTNApp still resident, I get "Application Already Exists" error.

Anyone know what I am doing wrong?

CODE:
public class IQConn extends IQ_32
{
//connection status parameters
int a, b;
Socket dtnSocket;
BufferedReader sin;
BufferedWriter sout;

public void connect()
{
RegisterClientApp( "IQFEED_DEMO", "1.0", "0.11111111" );
try
{
if( a != 0 || b != 0 ) return;

dtnSocket = new Socket( InetAddress.getByName( "localhost" ), 9100 );
dtnSocket.setSoTimeout(SOCKET_TIMEOUT_MILLISECONDS);
sin = new BufferedReader( new InputStreamReader( dtnSocket.getInputStream() ) );
sout = new BufferedWriter( new OutputStreamWriter( dtnSocket.getOutputStream() ) );
}
catch( Exception e )
{
e.printStackTrace();
}

return;
}

public void disconnect()
{
RemoveClientApp();
}
}

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Nov 8, 2006 04:12 PM          Msg. 2 of 4
I have been able to duplicate this issue in version 4.1.2.0

Your app is not properly being registered as a client in IQConnect. As a result, when your app closes, IQConnect isnt able to determine that it is time to shut itself down.

As a workaround, all you have to do is maintain a Level1 socket connection while your app is running. This will cause your java app to be properly registered as a client with IQConnect and will properly close when the level1 connection closes.

We will look into this functionality make changes as necessary in a future release.
Edited by DTN_Steve_S on Nov 8, 2006 at 04:13 PM

simon33
-Interested User-
Posts: 28
Joined: Apr 9, 2005


Posted: Nov 8, 2006 05:11 PM          Msg. 3 of 4
Thanks for the quick response: couple of follow-up questions:

1. I followed the Java example to register my client. Can you see what I am doing incorrectly in the above code?
2. The socket is the issue for us. Sometimes it just dies, which is why we are trying to relaunch the app. Are you implying that we should check that the socket is closed, and if it is create a new one?
3. Finally, what is a Level 1 socket? Is that a Financial term (level 2, etc) or a network term?

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Nov 8, 2006 05:32 PM          Msg. 4 of 4
1) From what I can tell, this is not a problem with your code.

2) When this dies, is a relaunch required or can you start another instance of your app and recieve data through that one? I am not suggesting this as a "workaround", I am simply asking this for troubleshooting purposes.

3) By "Level 1 socket" I am referring to a regular tcp socket connection to the Level1 port in IQConnect. All apps should maintain a connection to this port throughout the time they are active. All status updates are sent to the client via the level 1 port.
 

 

Time: Wed May 1, 2024 10:32 PM CFBB v1.2.0 13 ms.
© AderSoftware 2002-2003