This project extends the Phase 1 SimpleChat application using the OCSF framework. It introduces enhanced client-server functionality, command handling, and user identification to support a more interactive and robust messaging system.
- Graceful shutdown detection when server disconnects
- Support for custom port and host via command-line arguments
- Command interface using
#prefix:#quit,#logoff,#login#sethost,#setport,#gethost,#getport
- Mandatory login ID passed as first argument
- Automatic
#login <loginid>sent to server on connect
- Console interface via
ServerConsoleclass - Server commands:
#quit,#stop,#close,#start#setport <port>,#getport
- Displays connection/disconnection messages for clients
- Handles
#login <loginid>from clients- Stores login ID
- Prefixes messages with login ID
- Rejects duplicate or late login attempts
All 13 test cases from the assignment document were executed and passed:
- Server/client startup and shutdown
- Port changes and reconnections
- Login enforcement and message echoing
- Command handling on both client and server
java -cp bin edu.seg2105.server.ui.ServerConsole [port]