gcc -o myprgrm myprogram.c
gcc -lsocket -lnsl -o myprgrm myprogram.c
Some of the definitions and structures are different between the two types of systems, so what compiles on one might not compile on the other. But you can easily adapt the examples.
Nachum Danzig | Email: danzigjct.ac.il |
Office: Weiler 232 | telephone: 02-675-1218 |
I suggest that you start here. These notes were designed for use with a lecture, but they should be helpful even by themselves. Please e-mail me comments about them (see e-mail address below).
Here is a program to test it.
These are functions that do not work directly with sockets, but are often needed when programming sockets. There are links to C programs that use these functions.Some of these functions are also mentioned in the main socket function above. I have left them in here.
This is a detailed summery of the theory part of Dr. Bloch's TCP/IP class.
This is an excellent tutorial on TCP/IP. While it does not deal with programming with sockets, I recommend this as material for learning or reviewing the principles of TCP/IP.