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)




"Everything is working great with the API. I love it." - Comment from Calvin
"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.
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via Public Forum
"I was on the phone with a friend who uses CQG and right after the Fed announcement, CQG was as much as 30 seconds behind DTN.IQ. Some quotes were off by as much as 15-18 cents. Your feed never missed a beat." - Comment from Roger
"Excellent datafeed !!!" - Comment from Arely
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"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
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"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
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 »Trouble reconnecting
Author Topic: Trouble reconnecting (8 messages, Page 1 of 1)

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 11, 2005 07:49 PM          Msg. 1 of 8
My feed hiccupped today. The connection manager stayed alive but other than time stamps data (quotes) stopped flowing.

From another thread I see that sending "S,DISCONNECT\n" can be used to sumilate a disconnect, and it says sending "S,CONNECT\n" should reconnect. Disconnect is no problem and connection manager shows this status. When I send the connect instruction, connection manager reflects this by incrementing "Reconnections", but it fails. I bumped log level to 2. Here's a section of IQLog.txt:

2005-01-11 17:33:59: +Socket::Disconnect Deleting the symbollist
2005-01-11 17:33:59: +Socket::StartFeed Starting data feed
2005-01-11 17:33:59: +Socket::Connect Connecting to other IP address login.interquote.com:60020
2005-01-11 17:33:59: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:33:59: +Socket::FD_Connect Getting configurations
2005-01-11 17:33:59: +Socket::DecompressIPs Getting dynamic ip addresses
2005-01-11 17:33:59: +IQConnect::MainProc Connecting to IQ Connect
2005-01-11 17:33:59: +Socket::Connect Connecting to preset IP address 66.112.156.212:60000
2005-01-11 17:33:59: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:33:59: +Socket::FD_Connect Changing state to receive cookie
2005-01-11 17:33:59: +Socket::ParseLogin IQ Connect cookie ok
2005-01-11 17:33:59: +Socket::ParseLogin Sending login '******'
2005-01-11 17:34:00: +Socket::ParseLogin Sending password '****'
2005-01-11 17:34:00: +Socket::ParseLogin Done with authentication
2005-01-11 17:34:00: +Socket::Disconnect Setting client 368's pointers to NULL
2005-01-11 17:34:00: +Socket::ProcessReadyLine Processing ready line
2005-01-11 17:34:00: +Socket::StartFeed Starting data feed
2005-01-11 17:34:00: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002
2005-01-11 17:34:00: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:34:00: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002
2005-01-11 17:34:00: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:34:00: +IQConnect::MainProc Finished reconnecting
2005-01-11 17:34:00: +Socket::FD_Connect Getting configurations
2005-01-11 17:34:00: +Socket::FD_Connect Getting configurations
2005-01-11 17:35:01: +Socket::StartFeed Starting data feed
2005-01-11 17:35:01: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002
2005-01-11 17:35:01: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:35:01: +Socket::FD_Connect Getting configurations
2005-01-11 17:35:02: +Socket::StartFeed Starting data feed
2005-01-11 17:35:02: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002
2005-01-11 17:35:02: +Socket::Connect Connection initialized, waiting for FD_CONNECT message
2005-01-11 17:35:02: +Socket::FD_Connect Getting configurations

I tried sending the connect instruction when HandleMessage received "S,SERVER DISCONNECTED" (which happens twice), and then again if I still don't see any messages for 60 seconds after that. Neither seems to work.
Edited by DTN_Glenn_B on Jan 14, 2005 at 03:27 PM

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 14, 2005 07:43 AM          Msg. 2 of 8
Is there anyone from IQFeed monitoring this forum?

I would really appreciate some guidance on how to elegantly deal with these disconnect/reconnect events within my program.

BTW, I'm a paid up developer.

>Date: Fri, 26 Mar 2004 14:20:50 -0600
>From:
>Subject: Your IQ Developer Account is Now Active
>Thank you for registering as an IQFeed Developer. Your application has
>been approved and
>full access to the IQFeed developer area is now enabled. Please visit
>http://www.iqfeed.net/dev to download the API, view documentation, and
>receive developer
>support for the IQFeed service.
>
Edited by DTN_Steve_S on Sep 19, 2011 at 09:21 AM

DTN_Glenn_B
-Interested User-
Posts: 14
Joined: Nov 24, 2004


Posted: Jan 14, 2005 09:27 AM          Msg. 3 of 8
Sorry for the delay in a response. It's easy to miss new questions in a forum.

What indications are you getting that the reconnect fails? After sending the CONNECT message are you receving back a "S,SERVER CONNECTED" message? After this, you need to set everything again (ie. watch list, news options, etc...). I don't see anything in your log indicating that the connect isn't working.

Glenn Benes

Glenn Benes DTN Market Access, LLC.

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 14, 2005 09:42 AM          Msg. 4 of 8
Connection manager shows "Reconnections" incrementing, but I never see an "S,SERVER CONNECTED", nor does the status change to "Connected"

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 14, 2005 09:48 AM          Msg. 5 of 8
I can email you the full log file if that helps.

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 14, 2005 10:14 AM          Msg. 6 of 8
Taking a closer look at the log file, I notice when I send the S,SERVER CONNECT it logs:

2005-01-11 17:38:25: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002

I'm guessing 60002 is a port number. Normal connection shows:

2005-01-11 17:39:42: +Socket::Connect Connecting to other IP address login.interquote.com:60020
2005-01-11 17:39:42: +Socket::Connect Connecting to preset IP address 66.112.156.211:60000
2005-01-11 17:39:43: +Socket::Connect Connecting to preset IP address 66.112.156.222:60002

Now I wonder if (and how to) I should change the port to 60000

DTN_Glenn_B
-Interested User-
Posts: 14
Joined: Nov 24, 2004


Posted: Jan 14, 2005 12:46 PM          Msg. 7 of 8
You can send your log file to

The IP addresses/ports in the log pertain to IQConnect and the external servers. You cannot connect to them directly.

Like I said, according to the log snippit you posted, there isn't anything indicating a problem. For the next log please have it include the following sequence with the log level at 2.
RegisterClientApp and connect socket. Set a watch for MSFT. Send the disconnect. Reconnect. Finally, set a watch for MSFT again.

I will compare this to how it behaves for our apps.

Glenn Benes


Glenn Benes DTN Market Access, LLC.
Edited by DTN_Steve_S on Sep 19, 2011 at 10:58 AM

nsolot
-DTN Guru-
Posts: 273
Joined: Sep 4, 2004


Posted: Jan 15, 2005 11:25 AM          Msg. 8 of 8
Thanks Glenn for pointing me in the right direction. I solved the problem. Here's what I found to be the issue.

When I send "S,SERVER DISCONNECT" , I get back 2 "S,SERVER DISCONNECTED" messages approx one second apart. My original code would send "S,SERVER CONNECT" each time I received the disconnected message.

Setting log level to 4, I could see that IQ CM was attempting to reconnect, but the second time I sent the connect request it appears to mess things up.

I modified my code to ignore the second "S,SERVER DISCONNECTED" message and it works fine.
 

 

Time: Fri May 17, 2024 4:03 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003