EECS 3214 : Programming Assignment 1
Submit this assignment using the submit command (see the instructions below).
Getting familiar with client-server programming
Objective:
The objective of this lab is to get familiar with TCP/IP.
For this assignment, you should write a client/server application that does the following.
-
The server program runs waiting for a connection from a
client. It is not required to be concurrent.
- The clients and the server should (in general) run on different machines.
-
The client sends two lines to the server. The first line consists of an integer n. The next line has a string. Both n and the string must be read from command line. The server responds by sending n lines to the client, each containing the string sent by the client. The client then writes each of those n lines to a file "received.out" and quits.
- I prefer the programs be written in Java. If you are using python or C/C++, you will lose points if your program does not close the sockets when the program quits.
-
In order to prevent two students from using the same socket number on the
same machine, you should use the socket number that is 20000 + x, where x is
the last 4 digits of your student number.
-
Check the class page for clarifications etc.
-
You can download the basic client server code in the language of your choice from any site, including the page linked from the class webpage, but please cite that source in your report and code. Not doing so is a breach of academic honesty.
Some host names in one of the undergrad labs (LAS 1004) are ptl10,....,ptl23.
Compiling the server and client
programs (C language only)
-
Compile the programs with gcc instead of cc.
-
For the server program, you need the -lsocket flag
-
For the client program, you need the flags -lsocket -lnsl
Instructions for submitting
assignment 1
Submit the programs (source code only) using the following command:
- submit 3214 a1 <filenames>.
- Read the manpages ("man submit") for more details on the submit command. You can also use the web interface to the submit command.
- It may not be possible to submit the files after the deadline.
-
The programs you submit should work and be documented.
-
For this assignment, no report is needed. Include any assumptions you made in
the comments.
Demonstration
The TAs may ask you to demonstrate to them that your program works on the departmental Linux machines. You will run the server, and client (on separate machines) and show that the program implements the specifications described above.
Grading
Program works correctly : 60%
quality of code and in-line documentation : 40%
NOTE: Late submissions get no credit.
Copying, teamwork
Modifying the skeleton programs for client server programs is permitted. Otherwise, copying of programs (also written homeworks and exams) or teamwork on
an assignment (written or programming) is not permitted. No form
of copying is tolerated in this (or any) course, in accordance with
departmental policy.