Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-24-2005, 04:57 PM   #1
Registered: Jan 2002
Location: UK
Distribution: Slack 14.1
Posts: 193

Rep: Reputation: 30
socket pogramming(TCP)

Hi all!

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.

Old 10-24-2005, 06:07 PM   #2
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Re: socket pogramming(TCP)

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.

Last edited by dmail; 10-24-2005 at 06:11 PM.
Old 10-24-2005, 06:22 PM   #3
Senior Member
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
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.
Old 10-24-2005, 10:26 PM   #4
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
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.
Old 10-25-2005, 12:14 AM   #5
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux TCP Socket swa_dur Linux - Networking 3 09-23-2005 12:03 PM
socket buffer TCP lucs Slackware 0 05-05-2005 08:26 AM
filetransfer with socket and tcp biiiep Programming 2 06-11-2004 01:33 PM
tcp socket monitoring xuttux Linux - Networking 1 05-19-2004 09:49 AM
http, socket and tcp/ip comparison gogo Linux - Networking 5 10-05-2002 02:57 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration