Skip to content

MT24DSDV/Assignement2-Marcel_Traore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Assignement2-Marcel_Traore

SimpleChat Phase 2 – SEG2105 Assignment 2

πŸ“Œ Overview

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.

πŸ›  Features Implemented

βœ… Client-Side Enhancements

  • 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

βœ… Server-Side Enhancements

  • Console interface via ServerConsole class
  • 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

πŸ§ͺ Test Cases

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

πŸš€ How to Run

Server

java -cp bin edu.seg2105.server.ui.ServerConsole [port]

About

Simple Chat assignement

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages