• C

Network communication in C

Hi, I'm trying to write a simple C program that can communicate on a network (LAN or Internet - I don't care).
i.e. I want to be able to open a network connection to a remote machine on a given port (e.g. 80 TCP) and send/receive data.
Any protocols isn't important to me - I'm happy with the raw data for now.
Any ideas how I might go about this? Any libraries or things that might be useful?
I'd prefer to compile it on linux (with gcc) but I guess it doesn't matter that much if I do it on windows (with Turbo C 2.01).
Thanks in advance.
samwatersAsked:
Who is Participating?
 
sunnycoderCommented:
The best out there
www.ecst.csuchico.edu/~beej/guide/net/

Using protocols would be easier in the beginning ... raw data would require you to construct packets on your own. The above link has comprehensive information presented in a easy to digest manner ... go through it
0
 
brettmjohnsonCommented:
0
 
fridomCEO/ProgrammerCommented:
libcurl is what you want:
http://curl.haxx.se/libcurl/

Regards
Friedrich
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
grg99Commented:
0
 
smpoojaryCommented:
YOu can use socket programming. For this go to the link
http://www.ecst.csuchico.edu/~beej/guide/net/bgnet.pdf
-Mahesh
0
 
sunnycoderCommented:
smpoojary,

That is the same link as I posted !!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.