I have a experience of network programming in java... now i want to implement them in c with more better support, i have used c++ long time a ago... Now i dont know which compiler of c++ is better, which support socket api... and which operating system provide more flexibility to work... Advance thanx for your suggestions.

5 Years
Discussion Span
Last Post by doug65536

Hi.. I can answer only to your some of the questions as i too belong to Java category.

The best operating system to implement the network programming in C/C++ is definitely linux (because of multi-process nature).

The syntax and semantics of the network programming is somewhat different in linux..
(as we have in our academics i am telling you).

If you want to code in C/C++ in linux , learning the syntax is not enough(even-though all the libraries and syntax looks complex when compared to normal C)
you need to know the concepts of unix operating system.

I recommend you to take a glance at "Unix networking programming -Richard Stevans".

(Initially when i went through the network programming in C/C++ , i dropped the idea of implementing it in C since i found that implementing it in my favourate language java is lot more easier when compared to C/C++ :))

Anyway , if you want to gave a try it in C , go ahead....


It's the other way around, right? Don't you have requirements that it run on a given operating system, or a requirement that it be portable across a lot of operating systems?

The sockets API is my suggestion. It allows you to have code that is reasonably similar between unix and windows platforms. The big differences there are how to handle asynchronous operations.

Do you mean getting something to work at all, or a highly scalable network program that can handle thousands of simultaneous connections and be bulletproofed so disconnects or corrupt data won't cause program failures. If you need to make it high performance, you will have to do significant work to abstract it enough so you can use the high performance techniques that are specific to each platform.

Security is another big concern, you need to be robust enough to handle malicious data. You need to be robust enough to handle denial of service attacks while still allowing legitimate users to use the service.

You may need to have the ability to configure proxies if the server will be used in commercial environments. You may need to take firewalls into consideration when designing how it is implemented, such as which end of the connection makes the outbound connection.

You may need to choose whether you are going to be firewall friendly and do something "over HTTP", or if you are going to impose a requirement that administrators specifically open ports for it.

You need to consider the requirements of your protocol, such as choosing whether you can afford the latencies involved with TCP or add a ton of logic to do something really low latency with UDP while handling packet drops robustly.

With something as I/O bound as a network program, the compiler is not a really important piece of the design. Things like thread pooling and avoidance of kernel transitions and not pounding the heap allocator too hard will have a lot more impact than the code generator of your compiler.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.