Choice for Socket Server Application: C/C++ or C#
What would be the most sensible choice for building a socket server application, assuming that you had the luxury of choosing between C/C++ or Csharp, and you intend t开发者_如何学Co run multiple instances of the same server on both Windows and Linux servers?
If you can get the service to run on .NET in Windows and Linux (via Mono), C# is probably the "easier" environment to work with in terms of development.
The C++ route may be a little trickier - you'll have to compile the code for both Linux and Windows, which can get tricky if you're doing low-level/platform-dependent things in C++.
The C++ route may also perform a little better if the code is written well. If you have high load or performance requirements, C++ (or plain C) might be the better route.
on Linux?
C/C++
C/C++ based socket stuff is readily available, as is toolkits, frameworks and high-performance examples. Look to the FreeBSD system that provided tens of thousands of socket-based threads. C/C++ will do all you want with not much code.
However, if your business logic is all written inC#, then it may well be simpler and easier to write your socket in C# (though, if you're doing that, you should be looking to WCF).
For c++ I'd look for a library in http://www.boost.org/
精彩评论