ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am doing socket programming using C and Linux.
Does anyone know of any papers, documents or any articles that discuss why C is better for socket programming, what other languages it is possible to use, advantages and disadvantages, why use Linux or Windows, etc? Basically, looking into possibilities and choices of tools and ways to do soket programming.
Hi
Im doing a similar sort of thing, but making it cross platform compatible. As for C being better for socket programming, better than what ?cornflakes lol. I myself will be using C++ as you can think of sockets as objects and my final application will be mutilthreaded; I believe C++ would be far better for this sort of thing as its much easier to use encapsultation and inheritance for different os's etc. (you could use java , but the reason for my networking etc is for a opengl game). As for wether to use windows or linux, i dont see much difference. Yes there are different library calls etc but this is not something which should put you off from using one OS or the other.
I myself prefer Visual studio to anything linux can offer and for programming, this includes programming threads in windows using POSIX pthreads theres a nice library for this. http://sourceware.org/pthreads-win32/announcement.html
Socket programming is usually a very small part of the larger program. It might be wiser to ask which program you want to create your program in and then do the socket programming in that language if it's appropriate.
The advantage of C is obviously speed. I've seen someone calling it "portable assembler". I like it because it isn't a bloated language. It's the perfect mix of abstraction and machine level. I personally don't like the level by which other languages hide the implementation.
I don't see a way by which C would be better for TCP/IP sockets other than this. Although let's not forget that sockets were designed primarily on BSD. The interface and some of this code were re-used later on Winsock.
itsme86 is exactly right. 'C' can be an excellent choice for programming sockets ...
... but the *best* choice of all is the language that best fits the overall goals of your program. That, in turn, might be Java ... or Perl ... or just about anything imaginable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.