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 have to tell you though that using the IQFeed API is about the easiest and cleanest I have seen for some time." - Comment from Jim
"I started a trial a few weeks back before the market went wild. DTN.IQ didn’t miss anything and beat my other provider. I decided to stay with you because of the great service through all the volatility." - Comment from Mike
"Its working FABULOUSLY for me!! Holy cow...there has been so much I've been missing lately, and with this feed and Linnsoft software...I'm in the game now." - Comment from Chris R.
"I've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"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
"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
"DTN has never given me problems. It is incredibly stable. In fact I've occasionally lost the data feed from Interactive Brokers, but still been able to trade because I'm getting good data from DTN." - Comment from Leighton
"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
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"Everything is working great with the API. I love it." - Comment from Calvin
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 »How to make sure IQFeed 4.7.x beta connected?
Author Topic: How to make sure IQFeed 4.7.x beta connected? (11 messages, Page 1 of 1)

smt52
-Interested User-
Posts: 31
Joined: Feb 23, 2009


Posted: Dec 10, 2009 01:57 AM          Msg. 1 of 11
I'm using new IQFeed 4.7 approach to launch IQFeed child process with parameters. It's taking several seconds for IQConnect to login and to launch all sockets. If I trying to connect to the socket immediately after process started I can connect to admin socket only. So calling process need to wait for several seconds before connecting. This wait time varies depending of internet channel load and (probably) IQFeed server load.
This is not good approach to wait hardcoded number of seconds because of possibe race. So I created code which tries to connect to Level I socket with 1 second intervals until connected. Then this code holds this socket opened for several seconds to make sure IQFeed will not unload and let the main code to connect to IQFeed sockets. This all code works fine.
But, when main code tries to connect, it receives S,SERVER_DISCONNECTED message and does not work. If I trying to connect to IQFeed again (unload and load again) it repeats S,SERVER_DISCONNECTED message.
What is the correct approach to make sure IQConnect logged in and ready for connection?

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


Posted: Dec 10, 2009 08:25 AM          Msg. 2 of 11
On the initial launch, IQConnect only starts the Admin port until the first connection to the servers has been made.

The Stats message that is sent to the Admin socket should tell you when the connection has been established (it will change from saying that IQFeed is "Not Connected" to being "Connected". At that point, it is safe to establish all of your other connections and start making requests.

smt52
-Interested User-
Posts: 31
Joined: Feb 23, 2009


Posted: Dec 16, 2009 06:38 AM          Msg. 3 of 11
Hi, Steve.

Thank you very much for your advise. I used it and it working fine.

However I found another problem in the IQConnect 4.7 beta. The problem related to "S,CONNECT" command sent to admin socket. Unfortunately this command prevents IQConnect from connecting even when "S,SET SAVE LOGIN INFO,On" command sent or "-autoconnect" parameter sent through command line. When this command sent to IQConnect it starts in disconnected mode and even does not show login dialog.

Actually I tried to avoid using command-line parameter to pass credentials to IQConenct.exe (this is not safe). So I tried to use the following sequence of commans passed to admin interface:

SendMessageToServer("S,SET SAVE LOGIN INFO,Off");
SendMessageToServer("S,SET AUTOCONNECT,Off");

// Register application
SendMessageToServer(string.Format("S,REGISTER CLIENT APP,{0},{1}",_productName, _productVersion));

// Send credentials to IQConnect
SendMessageToServer(string.Format("S,SET LOGINID,{0}", login));
SendMessageToServer(string.Format("S,SET PASSWORD,{0}", password));

// Force server connection
SendMessageToServer("S,CONNECT");

IQConnect responds with messages that application is registered and credentials are set, but does not login.

Now I have rolled back to passing credentials through command-line parameters and setting "-autoconnect" and "-savelogininfo" parameters. Currently this is only approach which works with IQConnect.

How should I change my code to pass credentials through admin sockects and to make "S,CONNECT" command work correctly?

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


Posted: Dec 16, 2009 07:54 AM          Msg. 4 of 11
I am looking into this. If I understand what you are trying to do, it seems like you are doing everything correctly. I'll let you know what I come up with.

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


Posted: Dec 16, 2009 09:38 AM          Msg. 5 of 11
This is a bug in the beta. While the Login Dialog is displayed to the user, IQFeed is ignoring the S,CONNECT message sent on the admin socket.

This will be fixed in the next beta build. There will be two changes to the next build in this reguard. First, if IQConnect has not yet recieved a ProductID and Product version, the Login Dialog will not display to the user (it currently displays but with the connect button disabled). Second, if the S,CONNECT command is recieved while the Dialog is displayed to the user, it will Simulate the user clicking the Connect button.

smt52
-Interested User-
Posts: 31
Joined: Feb 23, 2009


Posted: Dec 16, 2009 10:45 AM          Msg. 6 of 11
Hi, Steve.

Thank you for reply. I seen the disabled "Connect" button and had all the problems you described. Will wait for the next beta.

Edited by smt52 on Dec 16, 2009 at 11:51 AM

smt52
-Interested User-
Posts: 31
Joined: Feb 23, 2009


Posted: Dec 18, 2009 06:29 AM          Msg. 7 of 11
Hi, Steve.

I just downloaded and tested lastest IQFeed 4.7.0.3 beta. "S,CONNECT" command now works, but it works only in one case, wneh:

SendMessageToServer("S,SET SAVE LOGIN INFO,On");
SendMessageToServer("S,SET AUTOCONNECT,On");

sent before the "S,REGISTER CLIENT APP" command. When I send

SendMessageToServer("S,SET SAVE LOGIN INFO,Off");
SendMessageToServer("S,SET AUTOCONNECT,On");

or

SendMessageToServer("S,SET SAVE LOGIN INFO,On");
SendMessageToServer("S,SET AUTOCONNECT,Off");

or

SendMessageToServer("S,SET SAVE LOGIN INFO,Off");
SendMessageToServer("S,SET AUTOCONNECT,Off"); // Most preferred combination

"S,CONNECT" command does nothing. IQConnect shows login dialog, but nothing happening until I click "Connect" button.

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


Posted: Dec 18, 2009 09:42 AM          Msg. 8 of 11
It sounds like this is working as intended for you.

The Set Autoconnect command is ignored if the login info is not saved which means that your first scenario (that doesn't work) is the same as the last one.

Essentially, the S,CONNECT command has the same functionality as if the user were to click "Start Feed" from the notification icon's right-click menu. When the user clicks this menu option having not yet logged in, it will cause the login dialog to display.

Anytime the login dialog window is displayed, it checks the save login info and autoconnect flags. If these are both set, it will autoconnect and hide itself (assuming it was successful). If either of them are not set, it will prompt the user to click connect.

We added the functionality that a S,CONNECT command while the dialog is displayed will force a connection attempt (as though the use clicked connect).

As a result, you have a couple options to make this work in the scenarios that you mention. You can either send an additional S,CONNECT command. Or you can set the save info and autoconnect ON, CONNECT, and then set them back off again.

smt52
-Interested User-
Posts: 31
Joined: Feb 23, 2009


Posted: Dec 18, 2009 12:35 PM          Msg. 9 of 11
Hi, Steve

Thank you for your kind help. Now it works as expected.

Before I sent "S,CONNECT" once and this happen before dialog showed up.

Now I'm sending "S,CONNECT" every second until it connected and connection works with autoconnect and savelogin both set to off.

mDelp
-Interested User-
Posts: 4
Joined: Dec 16, 2009


Posted: Dec 29, 2009 09:53 AM          Msg. 10 of 11
I am still not clear on this. In my program, autoconnect is not working as I expected.

When I run my program (and ShellExecute IQConnect.exe), the IQ Connect Login dialog appears. I enter my login and password, and I check the "Save Login And Password/Pin" and "Automatically Connect" check boxes. The program runs fine. Then I exit the program and exit IQ Feed. When I re-run my program, the Login dialog has remembered my kogin and password, but it does not autoconnect, and both check boxes are cleared.

This will surely confuse my users. I can already hear them say "Why does it not autoconnect and why do I have to keep telling it to remember my login?" Is there something else I need to do in my program? It doesn't make sense to me that autoconnect would only work if I am sending the login and password on the command line, which I would rather not do.

Thanks,
Mark

DTN_Nathan_Bartsch
-IQ Developer-
Posts: 33
Joined: May 3, 2004

Telvent DTN


Posted: Dec 29, 2009 10:23 AM          Msg. 11 of 11
There are issues with the current beta (4.7.0.3) that will be addressed in the next Beta build (4.7.0.4).

Copied from a different thread regarding autoconnect not working as expected:

"
Posted: Dec 22, 2009 10:18 AM Msg. 2 of 4
We have verified the problem and will include a fix in the next Beta build (4.7.0.4) which will be posted after the Holidays.

--------------------------------------------------------------------------------
Lonnie Shumate
Development Manager, IQ Systems
DTN Market ACCESS
"

Nathan W. Bartsch - Senior Software Engineer - DTN
 

 

Time: Sun April 28, 2024 3:24 PM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003