473,808 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unmanaged WinSock V.S. System.Net.Sock ets

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.Sock ets 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.Sock ets library be optimized???

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

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 5154
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***@discussi ons.microsoft.c om> wrote in message
news:3F******** *************** ***********@mic rosoft.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.Sock ets 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.Sock ets library be optimized???
What should I choose to implement a performance critical application? unmanaged WinSock or System.Net.Sock ets ?
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.Sock ets class. Feel free to email nc*****@microso ft.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
694
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 around I can make on the C# side to hear the connect request? -Bill (don't reply by e-mail, the address is a fake) ______________________________ Steps to reproduce: Start the C# Listener
0
1683
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 formats. I'm writing a new client that should be able to connect to the Winsock-based server. However, I can't get them to talk to each other. The server hears and understands what System.Net.Sockets is saying, but when it tries to respond...
6
10757
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
1702
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
6908
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 wrong). Also when we use the VB6 winsock control in a dotnet version we appear to lose the ability of creating an array on winsock's. for example we cannot assign as thus
6
3065
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
5437
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 server to make a rule for that IP for the time-credits left for that user. My problem is that so far, the program can handle everything except more then one client, and i have done my best, but i can't find a decent solution
1
4758
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 extracting from VB6's cabinets, but when using inside my project, i get some syntax problems which runs fine in VB6. I do not want to go back VB6. Is it healthy and supported using mswinsck.ocx Winsock control in VB.NET projects?
0
1251
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 only use winsock? So the service needs to send a message to the PC via some port say 8000. The service knows the IP address of the PC also. The system socket code sends the message and the VB6 exe has connected to the server on port 8000 but...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10374
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7651
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.