80 likes | 223 Views
PA1 discussion. Junxian (Jim) Huang hjx@eecs.umich.edu EECS 489 W11 http://www.eecs.umich.edu/courses/eecs489/w11/. PA1: Socket Programming. Due 1/23/2011 11:59PM EST Late policy will apply Submission / afs/umich.edu/class/eecs489/w10/SUBMIT/< uniqname >/hw1 Your task Server Client
E N D
PA1 discussion Junxian (Jim) Huang hjx@eecs.umich.edu EECS 489 W11 http://www.eecs.umich.edu/courses/eecs489/w11/
PA1: Socket Programming • Due 1/23/2011 11:59PM EST • Late policy will apply • Submission /afs/umich.edu/class/eecs489/w10/SUBMIT/<uniqname>/hw1 • Your task • Server • Client • Testing & debug • Questions? • Discussion in the forum (preferred) • Send me email or come to office hours
You are provided with .. • Makefile • make clean / make all / make tar • server.c • Skeleton for server • client.c • Skeleton for client • header.h • README • Data • Test input data
Sockets API • Applications need Application Programming Interface (API) to use the network • API: set of function types, data structures and constants • Allows programmer to learn once, write anywhere • Greatly simplifies job of application programmer application API transport network data-link physical
server.c • Input • ./server hostname port • Should not quit after 1 request • Runs forever unless killed by Ctrl+C • Should queue multiple connections (>= 5) • Prints out anything sent from client to standard output
client.c • Input • ./client port • After running, anything in the standard input is accepted include <ENTER> • When to quit? • When EOF or 2X<ENTER> is detected • Both of these termination conditions will be checked • Using pipe to direct a file content as input • ./client port < data
How to test & debug? • make (DEMO) • tcpdump (DEMO) • gdb (OPT DEMO)