CPEG419/CISC450 – Project 1

Basic Socket Communication

Write a client program that sends a "hello" to another host and waits for a response. And write a server program that waits for the "hello" and responds. Do this with both UDP and TCP. See UDP-info and TCP-info for a step-by-step guide on how to do this. In all cases, the server program should record each client program's hello message and gives its own response. The client program should record the response from the servers. Do this with both TCP and UDP. Include as arguments the port used and, for the client, include an argument of the destination IP address and port.

What to turn in: Four programs, namely a client and server for TCP and a client and server for UDP. However, the server and client can be merged into a single program. So, turn in two programs, one for UDP and one for TCP. Turn in the code as well as well formated output generated by the programs. The output should include the host and port communicated with or attempted as well as the message received. Messages should include the name of the author of the client/server.

For details on socket programming, see general socket info.