Introduction to Unix Network Programming
Useful Man Pages
- Headers: socket.h,
netdb.h,
- Functions: accept,
bind,
connect,
getpeername,
getsockname,
listen,
recvfrom,
send,
sendto,
setsockopt,
socket,
gethostname,
gethostbyname,
gethostbyaddr,
getaddrinfo,
freeaddrinfo, inet_pton, inet_ntop
- Memory and string manipulation:
On Coding Styles
Assignment 1
- Assignment 1 specification
- We provide you with 4 examples, following the line of presentation in R.
Stevens' Unix network programming book. All these link to tar files. To untar,
type "tar -xvf filename.tar". Then, cd into the untared directory
and type "make" to compile the programs. Read the README files in
each directory, and also the comments inside the source codes to see what's
going on. Especially, the first example has hard-coded IP, which was meant
for you to read and change the IP with your own machine's IP. To check your
machine's IP, use ifconfig as I've shown in class. In later examples, you
can type the server's IP address and port numbers as client's arguments.
- Some specific useful links for your project:
- You then can check out some more advanced documents (these are not absolutely
needed for the first phase of the project, read them if you have time)
Assignment 2