ELEG 651 and CPEG 419 – Project 1
Basic Socket Communication
for (i = 10; i<=35; i++) { sprintf(IPAddress,"128.4.61.%d",i); // the rest of your code }This method will be useful for the next project. So, in preperation, you should implement it.
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.
- Another way to define "servers in a range" is for them to be a set of servers on your machine with each server on a different port. Let suppose that you run your server on a few ports in the range of 10000 - 20000. Then you would have a loop that runs through this range ports and sends a hello to each server in this range. This approach is useful for testing your code on your own machine.
- The final way to define "servers in a range" is to provide a file that specifies all the possible IPs and ports that server applications might be. Then the client sends a hello to each host in the file. This technique will be used later in the semester, but code will be provided. So there is no need to implement this method. On the other hand, it other two methods are useful. But only one for this project, only one of these methods needs to be implemented.
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 well formated 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 socket programming, see general socket info.