- Lecture: Multi-threaded Servers.
- Lab:
- Compile and run
echoServer.java.
While it is still running compile and run
guiClient2.java.
Type some text into the client's user text box and observe what happens.
- Now start up another client and type some text into this client's user text box and observe what happens.
Add a few more clients.
- Each choose a port between 6000 and 6100 (Do it by your position in the register).
All compile and run a multi-Threaded echo server on igor.gold.ac.uk, listening on
your particular port.
- Adapt guiClient2.java so the user can choose the ip-adress and port of the server as command
line arguments
- Pick some of your friend in the class and see if you can connect to their server on igor.
- Adapt echoServer.java.
so it reads a line at a time rather than a character at a time and also it should indicate
the id of the client that the output is from. Number the first client 0 and the next 1 etc.
(Solution-stringEchoServer.java).
s.danicic@gold.ac.uk
Sebastian Danicic BSc MSc PhD (Reader in Computer Science)
Dept of Computing, Goldsmiths, University of London, London SE14 6NW
Last updated 2015-09-04