Demonstrate java client and server , JAVA Programming

There is no separate homework this week, but you may complete the exercises ahead of time, in which case you only need to attend for long enough to get your work marked off by your tutor. Also, we will arrange an overflow session later in the week for getting tasks marked off. The time for that session will be discussed and set during Monday's lecture.

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 (0.5%)

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

Task 2 (0.5%)

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

Task 3 (0.5%)

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:

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/16/2013 5:09:13 AM | Location : United States







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

Write discussion on Demonstrate java client and server
Your posts are moderated
Related Questions
Write a program that takes as input a sequence of transactions of the form "buy x; share(s) at $y each" or "sell x share(s) at $y each," assuming that the transactions occur on con

Mine craft plug-in Coder Project Description: Some custom plugging for my Mine craft server. Skills required: Java, Editing

I need to draw cars and trucks and background with road and a house with sky. I have to use Vehicle class as a parent class. To draw pictures, i should draw fun things coming up

how to write a program to assign value of variable age and print if person is major.

Java Program Development and Execution Steps Java program normally go through five phases. These are 1. Edit, 2. Compile, 3. Load, 4. Verify and 5. Execute Co

Write a programme to create a webpage that prints the name of the STUDENT database in Wide Latin font and set the subtitle with description of the STUDENT to the screen. Set the pa

Explain Parentheses in Java ? Sometimes the default sequence of evaluation isn't what you want. For example, the formula to change a Fahrenheit temperature to a Celsius tempera

What 'System.out.println()' signifies? 'System' is a predefined class. System class gives access to the system. 'out' is the output stream. 'println' is printin

Search on column demonstration in Semantic Vector Project Description: I am preparing a research on Semantic Vectors. But I am not able to check out in a vector representa

What is linear search? It is the simplest form of search. It searches for the element sequentially starting from first element. This search has a drawback if element is located