This project aims to implement a "home-made" chat protocol.
Find the RFC (redacted in French) in PDF format here.
It will be implemented using Java 24 for both the client and the server.
The global architecture of the server will have one main blocking thread accepting connections from clients and a pool of non-blocking threads that will handle every client with a Selector each
The main loop of those threads will use the select method to check every client that has been registered into it so that it can process the data.
The architecture of the client will have two threads :
- one for reading user inputs from the console
- one for managing the network part
The network thread will also be non-blocking with a Selector and the console thread will be blocking, reading from the standard input.
The messages will be processed from the console thread to the network thread using a custom thread-safe class.
A user will write messages and press return to send the message.
If a message starts with / (slash), it will be interpreted like a command.
Here is the list of commands a user can use :
/connect user(alias/c user) send a request touserto start a private conversation/accept user(alias/a user)accept the request fromuserthat asked for a private conversation/deny user(alias/d user) denies the request fromuserthat asked for a private conversation/requests (sent/received)shows every pending request for private conversations the user has sent or received/help(alias/h) shows help for every command