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)




"If you want customer service that answers the phone, your best bet is IQFeed. I cannot stop praising them or their technical support. They are always there for you, and they are quick. I have used ****** too but the best value is IQFeed." - Comment from Public Forum
"Thanks for all of your help. Great customer service deserves to be recognized which one the reasons I've been a customer of DTN for over 10 years!" - Comment from Stuart
"I am enjoying the feed very much - so superior to the broker provided feed I was previously using." - Comment from George
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"Previously I was using *******. IQFeed is WAY more economical, and for my charting needs is just as good, if not better." - Comment from Public Forum Post
"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
"DTN feed was the only feed that consistently matched Bloomberg feed for BID/ASK data verification work these past years......DTN feed is a must for my supply & demand based trading using Cumulative Delta" - Comment from Public Forum Post
"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
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"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 »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: Sun May 19, 2024 12:36 PM CFBB v1.2.0 9 ms.
© AderSoftware 2002-2003