Messenger created as a project for studies. Simple broadcast messenger to send text messages, images (.jpg format) or sound files (.wav format) from one client to all clients connected to server .
Java 15
$ javac Server.java
$ java Server
$ javac Client.java
$ java Client
The client can send a message(with the generated information about who sent it), that will be delivered to all clients connected to the server
$ text
$ This is a message
$ Client 1: This is a message
The client can send a photos in .jpg format. Other clients will receive information about the author of message and image will open in external window
$ image
$ image_name.jpg
$ Received image from client 1
The client can send a sound file in .wav format. Other clients will receive information about the author of the message and the sound will play.
$ sound
$ sound.wav
$ Received audio file from client 1
To disconnect client just type:
$ logout
- Observer : After each received message by Server, all other clients connected to the server are notified using notifyObservers() method in the Server class
- Chain Element : Allows requests to be forwarded to subsequent object along the chain(TextElement -> ImageElement -> AudioElement), when that object is not responsible for the received event
- Template method pattern : Creates a skeleton of the algorithm and allows the subclasses to override methods of parent class except template method