Develop the "fridge magnet" client/server application.
Please see the Releases for precompiled builds.
See assignment at http://cs.smu.ca/~jdeveaux/csci/3465/2014/assign3.html
- [✓] Fridge (server) contains letters placed randomly on the "door".
- [✓] Real-time syncing between all Kids (clients) observing the Fridge (server).
- [✓] When a kid (client) leaves (disconnects from) the fridge (server), the fridge gracefully removes that client's connection.
- [✓] Client/Server style as a variation of the Observer pattern as demonstrated in the ChatClient/ChatServer programs.
- [✓] Must implement this application using Sockets to establish the client/server connection.
- [✓] Include your name in the corner of your frame.
- [✓] Detailed instructions on how to get the client and server to communicate to each other. See documentation below.
- [✓] Command-Line Interface for advanced customization.
Develop one (or more) versions of the "fridge magnet" client/server application. Your fridge (server) contains letters placed randomly on the door. Your kids (clients) will approach the fridge and be allowed to move some of the letters. Multiple kids can move letters on the fridge (although not necessarily the same letter) simultaneously When one kid moves a letter, all of the other kids will see that letter move, in real time When a kid leaves the fridge, the fridge doesn't fall to pieces (graceful connection termination)
This assignment is meant to be written in a client/server style as a variation of the Observer pattern as demonstrated in the ChatClient/ChatServer programs.
At the very least, you must implement this application using Sockets to establish the client/server connection. Bonus marks will be awarded for including a version where the client and server communicate with each other using RMI or SocketChannels
Provide DETAILED INSTRUCTIONS on how to get the client and server to communicate to each other:
- On the same machine
- On separate machines
Be sure to include your name in the corner of your frame!
Notes: Your assignments will be marked based on the effectiveness of your solution, as well as the way your make use of classes and interfaces in your solution.
See http://glavin001.github.io/CSCI3465-Assignment3/Assignment3/doc/
Server CLI (Fridge)
java -jar FridgeServer.jar <port>
port
- Default is6666
.
Open and execute the FridgeServer.jar
file or run the following command:
java -jar FridgeServer.jar
java -jar FridgeServer.jar 6666
Client CLI (Kid)
java -jar KidClient.jar <hostname> <port>
Note that both arguments must be used or they will not be applied.
hostname
- Default is "localhost
".port
- Default is6666
.
Open and execute the KidClient.jar
file or run the following command:
java -jar KidClient.jar
java -jar KidClient.jar localhost 6666
Using defaults: Hostname = "localhost
", Port = 6666
-
Repeat step 2 for as many clients as desired.
The important change is that you now must specify a different IP address (and possibly port number) for your Client (Kid) to lookup the Server (Fridge).
-
Start the Fridge (Server) .jar executible. Take note of the Server's IP address. See How to Find Your Local and External IP Address.
-
Repeat step 2 for as many clients as desired.