Demonstrate a minimal server and client program, JAVA Programming

This exercise will give you some introductory exposure to network programming with sockets. Your task is to demonstrate a minimal server program and client program that can send one small text message to each other. You need to do this in Java and also in C. Note, however, that for this exercise you are free to source example code from anywhere you like, including the internet and fellow students, as long as you can compile it, demonstrate it running, and answer your tutor's questions about how it works.

Task 1

Demonstrate a Java client and server exchanging one text message in each direction.

Task 2

Demonstrate a C client and server exchanging one text message in each direction.

Task 3

Demonstrate your C client exchanging one message in each direction with your Java server, or vice versa.

Further Requirements:

1. Your code must run on the CSEM unix computers to earn marks.

2. Your client code should accept an arbitrary text message from the user, up to at least 40 characters in length, and send it to your server. String input can be as a command-line parameter or as standard input (whichever you prefer - not necessary to do both).

3. Your server should display the incoming client message on-screen. The simplest way to do this is to use System.out.println() in Java or printf() in C to write to standard out.

4. Your server should then send a message back to the client which contains the original message, prepended with a short prefix string. The prefix string should be supplied by the user (again, either as a command-line argument, or read from stdin).

5. Your client should display on-screen the message it receives from the server.

6. You need to be able to show your tutor that you can compile and run the code yourself, and your tutor may ask you some questions about the code to check that you do have some basic understanding of what it is doing.

7. You MUST run your server code ONLY on barker, not on any other CSEM machine. You can log into barker by typing ssh barker from any CSEM student login machine. Address details for barker are: DNS Name: barker.csem.flinders.edu.au IP Address: 129.96.22.79

8. Your server MUST use a port number that is equal to YOUR unix uid number. This is to ensure that every student uses a unique port number so we don't get conflicts. To find your unix uid number, type the "id" at the command prompt on any CSEM unix host and use the number displayed after "uid=".

NOTE: Rules 7 and 8 have been specified by the Manager, CSEM Computing Services Group and MUST be complied with by all students. Breaches may attract undesirable consequences.

Posted Date: 3/1/2013 12:36:04 AM | Location : United States







Related Discussions:- Demonstrate a minimal server and client program, Assignment Help, Ask Question on Demonstrate a minimal server and client program, Get Answer, Expert's Help, Demonstrate a minimal server and client program Discussions

Write discussion on Demonstrate a minimal server and client program
Your posts are moderated
Related Questions
Give an Examples of Access Protection ? This is how the Car class would almost certainly be written in practice. Remember that all the fields are now declared private, and the

Individual Assignment Rework Asteroids to have a different gameplay In the previous assignments, we have developed an Asteroids game. In this assignment, we are going to u

What is ARPANET and who developed it? ARPANET stands for Advanced Research Projects. The initial reasons were to communicate along with and share computer resources between mainl

#comparison of merge sort and bubble sort

If there exist multiple conditions, the switch statement is suggested. It is because only one expression gets evaluated depending on which control jumps directly to the respective

In this assignment, you will create 5 objects and get them to interact together. You will create theatres for which patrons will buy tickets from a box office to watch movies.

A Queue of Cards You are going to parallel the development done in the lesson on inheritance where we constructed some base classes, StackNode and Stack, and derived  Floa

You are to write a Java console application, following the Software Life Cycle model, which will read personnel records from a text file and store them in a data structure.  One li

Explain java.lang.string library in java? Strings are objects. Specifically they're instances of the class java.lang.String . This class has several methods which are useful f

Explain The different kinds of exceptions ? Checked Exceptions  : Environmental error in which cannot necessarily be detected through testing; e.g. broken socket, disk full,