CPEG 419 – Project 1

Due in lab during the week of 9/12

Basic Socket Communication

  1. Write a client program that sends a "hello" to another host. 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.
  2. Extend your client program to find all the hosts in the lab and tell them hello. (Try to connect to an address, if the connection is successful (see what connect returns), then send the hello). And write a server program that records each client programs hello message and gives its own response. The client program should record the response from the servers. Do this with both TCP and UDP.

What to turn in: This project consists of eight programs (two clients and two servers and for TCP and UDP). Turn in the code as well as the output generated by the programs. Since part A and B are so similar, just turn in 4 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 programming with UCP and TCP, see UDP-info, TCP-info, and general socket info.