CS557

Take-Home Final Examination


Introduction

The purpose of this assignment is to extend client and server programs that communicate using windows sockets and the TCP protocol. Working basic client and server code is provided as:

final_01.zip - A server that sends each new connection off to its own thread to be handled while the main thread sits in a loop accepting connections.
final_02.zip - A client that uses blocking sockets.

These sample programs are based on implementations from here.

As these programs are currently written:

Both client and server programs require command line arguments of:

Server Modifications Required

The server will continue to act as an echo server for the client. You will need to add:

Client Modification Required

The client currently sends a single message, waits for it's return and then shuts down. You will modify the client to spawn a variable number of threads, each of which communicate with the echo server a fixed number of times and with a random message of fixed size. The modified client program will require command line arguments of:

Use code simular to the following to generate the random messages:

char message[SizeOfRandomMessage];
for(int i = 0; i < SizeOfRandomMessage; i++) {
	int j = rand() % 128;
	while(!isprint(j)) j = rand() % 128;
	message[i] = (char) j;
}

The client should continue to verify that the message sent is the same as the one received.

The client should be largely silent. It should only report if a message has not been verified.

DUE

This final project is due to your instructor via email by 6:30, Monday December 11, 2006.