Homework 7 -- Networking in Java


Create a drop-off directory within your Computer Science home directory by typing the following commands:

The problem

Like in homework 4, you'll create either a client or server. The networked application is simple. A server accepts connections from two clients. When a client first connects it receives the message:

This message is always followed by a Java end-of-line. Note that this same message is sent even if the connecting client is the second client to make the connection.

After both clients have made a connection, the server transmits:

where hostname is the name of the computer running the other connection. In the case, different message are sent to the two clients.

Then both clients transmit a three-character string followed by a Java end-olf-line.

The server responds the six-character string formed by concatenating the two three-character strings sent by the clients.

The assignment

This assignment must be written in Java.

This is a 20 point assignment that can be completed at different levels. Your completed assignment should be stored in the directory ~/csci/343/home07 that you created above.

The C level

You write the client program. This program will be a minor modification of the example Java client shown in class.

The B point level

You write a sequential server application, one that can handle only one pair of connections at a time. Start with the example Java server discussed in class.

The A point level

Do more that the B-level. You can write a concurrent server, you can write a server with logs, or you can do something imaginative.

Diaries and groups

You can do this assignment at any level in groups of up to three people provided each of you keep a diary as discussed in Homework 4

Asking for help

You are not allowed to show (or email) your code to someone who is not a member of your group without the explicit permission of the instructor. You are also not allowed to review the code of others without their explicit permission.

Checking with a server

A server is running at port 2362, that's 1999 + 363, on enka.cs.unca.edu that you may use to test your client.

Due dates and turning it in

This assignment is due at 12:00 noon on Friday, 10 December. No late assignments will be accepted because grades are due the following day.

Back to the CSCI 363 homework page
Back to the CSCI 363 home page