473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

unmanaged WinSock V.S. System.Net.Sockets

Hi,

I am about to write a performance critical application and I wonder what is the best way to implement it... Should I use the standart Win32 winsock DLL or should I rather use the new managed System.Net.Sockets library... from bench-marking tests I have done I have reached to the following conclusion:
Test description:
Bougth of the projects used a single IO Completion port for communication ( the managed proj used NetworkStream that use a common completion port internally ), bougth of the projects allocated the requiered memory apriory so the reception process will not require redundunt allocations.
the unmanaged C++ project resulted better performance, about 1.333 times of the managed project...
Taking those results in mind, I wonder...
1. Will microsoft keep supporting the 'old' winsock DLL ( which apparently give much better performance ) for porposes other then backword compatibility?
2. Does the .NET framework use the WinSock DLL or it rather communicate with the tcpip.sys driver directly through IOCTL calls?
3. What are the plans for Longhorn and for the next version of VS.NET? would the System.Net.Sockets library be optimized???

What should I choose to implement a performance critical application? unmanaged WinSock or System.Net.Sockets ?

Should I use Mixed mode C++? Would the wedby version of VS.NET have major changes for the Mixed mode C++?

Nadav
http://www.ddevel.com
Nov 17 '05 #1
2 5132
Bear in mind that code you write as unmanaged code may not necessarily be
the best implementation in managed code; it's possible you could squeeze
some performance out of the managed version by structuring things
differently. .NET makes development time MUCH shorter; unmanaged c++ is
quicker for processor intensive applications. But the limiting factor here
will be network bandwidth; unless you're doing tonnes of real-time
processing on the data you shouldn't see a big performance difference. You
usually only see a performance hit for really intensive computation (image
processing, for example).

Try posting the benchmark code you used; one of the gurus may be able to
give you some pointers.

Steve

"Nadav" <Na***@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
Hi,

I am about to write a performance critical application and I wonder what is the best way to implement it... Should I use the standart Win32 winsock
DLL or should I rather use the new managed System.Net.Sockets library...
from bench-marking tests I have done I have reached to the following
conclusion: Test description:
Bougth of the projects used a single IO Completion port for communication ( the managed proj used NetworkStream that use a common completion port
internally ), bougth of the projects allocated the requiered memory apriory
so the reception process will not require redundunt allocations. the unmanaged C++ project resulted better performance, about 1.333 times of the managed project... Taking those results in mind, I wonder...
1. Will microsoft keep supporting the 'old' winsock DLL ( which apparently give much better performance ) for porposes other then backword
compatibility? 2. Does the .NET framework use the WinSock DLL or it rather communicate with the tcpip.sys driver directly through IOCTL calls? 3. What are the plans for Longhorn and for the next version of VS.NET? would the System.Net.Sockets library be optimized???
What should I choose to implement a performance critical application? unmanaged WinSock or System.Net.Sockets ?
Should I use Mixed mode C++? Would the wedby version of VS.NET have major changes for the Mixed mode C++?
Nadav
http://www.ddevel.com

Nov 17 '05 #2

You are correct there is a performance difference between the two as you
note. We are looking at performance improvements to the
System.Net.Sockets class. Feel free to email nc*****@microsoft.com to
request a feature or performance improvement to any of the classes in
the System.Net namespace.

Btw, did you go with Winsock or System.Net for your project? I'd like
to hear why you chose one over the other.
The system.net team blog: http://blogs.msdn.com/wndp
-Mike
http://blogs.msdn.com/mflasko

--
MikeFl
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Apr 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
0
by: Björn Pedersen | last post by:
I'm having a tough time getting System.Net.Sockets to work with a server that's based around Winsock 6.0. For many reasons I can't write a new server because the server handles a number of client...
6
by: Donald | last post by:
Hey, I want to start using winsock in VB.NET, but cannot find anygood books on it. No one has any. Did winsock get renamed, or does .NET now use something else for internet stuff? Thanks.
2
by: ValK | last post by:
Hi. Does .NET have something Similar to WinSock ocx? I reviewed System.Net.Sockets. It works good, but I really like event 'DataArrival' that old WinSock have. Thanks,
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
6
by: Rain | last post by:
Does anybody know where i can get a winsock class for C#? badly needed. ANy help would be very much appreciated. Thank you so so much! -Stan
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
1
by: kimiraikkonen | last post by:
Hi, As you know there's no mswinsck.ocx ActiveX control in VB.NET 2005 or 08 by default, but it exists in VB6. However i can add this old control to my VB 2005 toolbox with no problem by...
0
by: =?Utf-8?B?TWFydGluVGVlZnk=?= | last post by:
Hi, I've read a lot about the use of system sockets in Vb.net instead of winsock fine but how do i get a vb.net service running on a 2003 server to send a message to a desktop vb6 exe that can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.