LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-24-2005, 03:57 PM   #1
hubabuba
Member
 
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.

Thanks
 
Old 10-24-2005, 05:07 PM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

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


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

Last edited by dmail; 10-24-2005 at 05:11 PM.
 
Old 10-24-2005, 05:22 PM   #3
itsme86
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, 09:26 PM   #4
primo
Member
 
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-24-2005, 11:14 PM   #5
paulsm4
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.

IMHO .. pSM
 
  


Reply


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 11:03 AM
socket buffer TCP lucs Slackware 0 05-05-2005 07:26 AM
filetransfer with socket and tcp biiiep Programming 2 06-11-2004 12:33 PM
tcp socket monitoring xuttux Linux - Networking 1 05-19-2004 08:49 AM
http, socket and tcp/ip comparison gogo Linux - Networking 5 10-05-2002 01:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:49 AM.

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