CSCI 363 Project 3

This assignment is due Friday, 21 November, 2003 at 11:00 am.

The task

This time you're going to write a server. You server should be able to run under the Linux operating system and should be placed in the directory ~/csci/363/exer03 . Your server should be written so that it can be started by executing the following command in your exer03 directory:

In this command port is the TCP port which your server will open and accept connections.

If you write your server is java, you will need to create a simple shell called solution to start your server. Here's an example on a script for Java. By the way, once you save the script, you must make sure it is executable by executing the Linux command "chmod a+x solution".

#! /bin/sh
java Solution $1

The server

After your server accepts a remote connection, it will reply with the following message, which must be terminated by the standard \r\n:

The client should respond with a number within the specified range. Your server should reply with one of the following messages.

In the first two cases the server will continue to accept new guesses. In the last two cases the server closes the connection. In the third case the NN is the number of times required to successfully guess the number. The very last case is for those instances in which the client provides improper input.


Server programs are expected to be well-written and well-documented. They are also expected to be robust. In order to receive more the 85% credit for this assignment, your server must also be able to process concurrent client connections!

Turning in the assignment

You may write your program in any programming language that runs on the UNCA CSCI Linux workstations. You should include in your exer03 directory, a Makefile which supports the commands make clean, to remove all complied code, and make all, to compile your code from source. If you never used Make, you can find many Make tutorial on the Internet.

Here's an example of an acceptable Makefile that will work for a program compiled from a single source file. By the way, those intendented lines must start with tabs.

all:           solution

solution:      solution.c
       gcc -o solution solution.c

       rm -rf solution *.o