Olaseni
Olaseni

Reputation: 7916

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 to run multiple instances of the same server on both Windows and Linux servers?

Upvotes: 2

Views: 501

Answers (3)

xain
xain

Reputation: 13839

For c++ I'd look for a library in http://www.boost.org/

Upvotes: 0

gbjbaanb
gbjbaanb

Reputation: 52659

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).

Upvotes: 1

Andy White
Andy White

Reputation: 88345

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.

Upvotes: 2

Related Questions