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)




"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
"Everything is working great ! Very impressive client. The news refreshes better and is more pertinent than the ******* feed I paid $ 100/month for. I Also like the charts a lot." - Comment from Leon
"I "bracket trade" all major news releases and I have not found one lag or glitch with DTN.IQ feed. I am very comfortable with their feed under all typical news conditions (Fed releases, employment numbers, etc)." - Comment from Public Forum
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"The people at Nirvana have very nice things to say about your company and I can see why! Price and service is a potent combination." - Comment from Ed
"It’s so nice to be working with real professionals!" - Comment from Len
"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
"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"This beats the pants off CQG, I am definitely switching to the ProphetX 3.0!" - Comment from Stephen
"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 »C# sample program for Leve1Socket
Author Topic: C# sample program for Leve1Socket (6 messages, Page 1 of 1)

Lav2018
-Interested User-
Posts: 10
Joined: Mar 15, 2018


Posted: Apr 4, 2018 08:55 PM          Msg. 1 of 6
I've found all of the sample C# programs very helpful and the comments make for easy following. I have one question about the Level1Socket program.

In Level1SocketForm.cs, lines 201-202 are:

 
// move on to the next message. This isn't very efficient but it is simple (which is the focus of this example).
sData = sData.Substring(sLine.Length + 1);


Do you have any examples showing more efficient ways? If not, can you please point me towards a better solution. Thank you.

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


Posted: Apr 5, 2018 08:06 AM          Msg. 2 of 6
You would want to do something that doesn't involve creating additional strings whenever possible. Anything that does a string copy like this can be costly. I did some looking and substring and split both have this kind of behavior, so I would probably look into MemoryStreams or a StringReader as possible alternatives, but I have not done any testing of those options to confirm their performance.

https://msdn.microsoft.com/en-us/library/system.io.stringreader(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.io.memorystream(v=vs.110).aspx

Tim

Lav2018
-Interested User-
Posts: 10
Joined: Mar 15, 2018


Posted: Apr 5, 2018 02:51 PM          Msg. 3 of 6
Makes sense. Thanks.

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 18, 2018 06:43 AM          Msg. 4 of 6
Hello Lav2018,

Please have a look to my open source C# IQFeed client.

https://github.com/mathpaquette/IQFeed.CSharpApiClient

Your feedbacks are welcome!
Mathieu

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 18, 2018 07:14 AM          Msg. 5 of 6
Well, I'm still skeptical about the real performance benefit of not using .Split. I'll do some performance tests to conclude on this.

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 22, 2018 08:06 PM          Msg. 6 of 6
 

 

Time: Fri April 19, 2024 11:26 AM CFBB v1.2.0 11 ms.
© AderSoftware 2002-2003