September 29th, 2003, 05:03 PM
Socket Programming in C
I'm looking for any simple socket programming tutorial or e-book that you know. I have just began to study socket programming. I'm expecting your replies. Thanks...
September 29th, 2003, 05:06 PM
google for 'beej's socket tutorial'
September 29th, 2003, 06:26 PM
*shameless plug* :D
(Ok, ok, so I didn't write it, I just translated it to dutch, as well as host a mirror...)
"A poor programmer is he who blames his tools."
September 29th, 2003, 07:12 PM
The other question: Windows or Linux/UNIX?
The standard sockets API that you learn for UNIX and which Beej's covers very well can be applied to Windows almost directly, but there are a few changes that must be made. These are covered on my Winsock page at http://members.aol.com/DSC30574/sockets/winsock.html .
And a word of advice. It's easy to hold off from writing sockets programs until you feel that you've learned enough, until you've figured it all out. Don't let that stop you. Jump right in with sample code; it's easier than it looks at first.
"The Pocket Guide to TCP/IP Sockets: C Version" by Michael J. Donahoo and Kenneth L. Calvert is a hard-copy book (130 pages, US$14.95, second edition title: "TCP/IP Sockets in C: Practical Guide for Programmers"). It's what got me to finally break out of my "analysis paralysis" and start playing with actual code. Even if you don't get the book, their web site at http://cs.baylor.edu/~donahoo/PocketSocket/ has their source code (for UNIX) and the same source code converted to Winsock for Windows. Consider that for a source of working code to start from (echo servers and clients, tcp or udp). It's usually a good idea to have a working server before writing a client and vice versa.
Have fun. And watch out for byte order.
September 29th, 2003, 07:37 PM
Thanks for all responses. I haven't decided to use windows or unix however I think it is more easy to use windows at first for learning.