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'm satisfied with IQFeed. It's the most reliable and fastest quote feed I have ever used. Although I'm a resident in China, it's still very fast!" - Comment from Xiaofei
"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'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.
"Can I get another account from you? I am tired of ******* going down so often" - Comment from George
"I am enjoying the feed very much - so superior to the broker provided feed I was previously using." - Comment from George
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"This is an excellent value, the system is generous (allowing for 500 stocks) and stable (and really is tick-by-tick), and the support is fantastic." - Comment from Shirin via Email
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"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
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 »Linux C++: Problems getting started with LookupSocket
Author Topic: Linux C++: Problems getting started with LookupSocket (3 messages, Page 1 of 1)

Aldebaran
-Interested User-
Posts: 8
Joined: Sep 24, 2015


Posted: Oct 10, 2015 01:56 PM          Msg. 1 of 3
Hi all

I am new to IQFeed but after good advice from Tim I managed getting started with the help of the ConsoleBenchmark code example. I have the "challenge" that I am running on Linux and therefore have to rephrase parts of the code to compile it. It also adds the extra layer of using Wine though it was actually straightforward.

Now I am trying to receive historical data via the LookupSocket but here I run into trouble.

The program starts by connecting to the AdminSocket, then the LookupSocket. After connecting I send information about the protocol I'll use ("S,SET PROTOCOL,5.1\r\n"). I am a bit confused since in the examples I find such commands terminated with "\n" some places, "\r\n" elsewhere. My impression is that the last is the correct format, but I would be very happy if someone would give me a punch the right direction. No matter how I terminate the command my application outputs "err:ole:CoUninitialize Mismatched CoUninitialize" which I think comes from Wine. But still I get suspicious that I might do something wrong. At this point the program runs without any further trouble.

Second I send the command telling what format and symbol I would like to receive data on and now I run into real problems. I have tried 2 approaches:

1) If I use a Linux'yfied version of the receive code logic in the ConsoleBenchmark application I receive (using recv in Linux) confirmation of the protocol, i.e., "S,CURRENT PROTOCOL,5.1", but then nothing else arrives. The application just hangs in the following receive.

2) If I use a version of the receive code logic from the HistorySocket example I receive a string that looks like \\000\000\000\... but no data.

First of all I would of course be interested if someone has an idea about what might go wrong. I would also be interested if someone can see why the 2 approaches yield different results.

Please let me know if you need further information to help diagnosing what I am doing wrong.

I will be very happy for any hint that might lead me in the right direction.

All the best, Peter

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


Posted: Oct 12, 2015 05:25 AM          Msg. 2 of 3
Good morning,

There should not be any need to change the sample code on the benchmark for it to run with Wine that I have heard of, but if you could send me your changes I will take a look to see what jumps out at me. It appears that something is getting corrupted in your socket, but I am not sure what.

You can also enable logging, via right click on the system tray icon ->support->Launch diagnostics, and then add logging so you can see what the socket is actually receiving and returning, versus what you are getting in your output.

/r/n is expected to follow all of your commands that you will send to the server. Since the servers are Linux based though, many of the returns will just be /n terminated as per the docs. If you have one that doesn't look right though, let me know and I will check.

S,SET PROTOCOL,5.1<CR><LF>
S,CURRENT PROTOCOL,5.1<LF>

Tim

Aldebaran
-Interested User-
Posts: 8
Joined: Sep 24, 2015


Posted: Oct 12, 2015 02:29 PM          Msg. 3 of 3
Hi Tim

Thanks once again for really good advice! What you explain about the difference in <CR><LF> and <LF> makes good sense and fits with my observations in the documentation.

I have tried to turn logging on via send a "S,SET LOG LEVELS,.." command which has not worked. I had not tried the right click option on the system tray icon which as you described led me to set log levels. Examining the logs it turned out that the command I sent requesting historical data on the lookup socket did not work why I did not receive anything. Fair enough :). After changing the code the problem disappeared but I honestly do not know what caused it. Sorry for wasting your time, but your answers helped go in the right direction and solve the issue myself. So I am very happy.

With regards to changing code to make it run on Wine, you are right nothing is needed in the sense that ale the compiled .exes that ship with the API works (all I have tried at least). But on Linux I am compiling with gcc and some function have different names, signature and/or are implemented differently (I think) under the hood. I am sorry for not making that clear in my original post.

Once again thanks for your great help and support, Peter
 

 

Time: Thu April 25, 2024 8:50 AM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003