Implement client group chat .
Implement one to one client file transmission.
Implement group client file transmission.
- Java 11
- Pravega 0.10.1
- IntelliJ
In my group chat architecture, one stream serves as a message-exchange center for a chat room. Each client in a chat room will create their own Writer, ReaderGroup and Reader based on their client ID and connect to one stream based on chat room ID.
For writing task, client can push a string as an event to their connected stream.
For reading task, each client will create a reading thread, this reading thread will constantly pull data from connected stream until it received a interrupt from client.
Client will be terminated when user type "Bye." in System.in.
- Running instructions
- run "GroupChat.java"
- input client name in terminal
- input chat room ID in terminal
- start chatting!
- Terminate your client with "Bye." message
When a client makes a request for uploading a file, a new stream will be created based on the hashed result of uploaderID, receiverID and fileName. File data will be uploaded to that stream. When another client want to download that file, a mapping uploaderID, receiverID and file name need to be provided.
- Running instructions
-
run "GroupChat.java" as previous.
-
Type "Upload" in chat room when you want to upload file to a user.
-
choose "One to one file transfer" mode.
-
input receiver client ID.
-
input the path or the name of a file that you want to upload.
-
If file is uploaded successfully, a message will be sent to chat room: (ClientID):Upload_(fileName)to(receiverID)
- Running instructions
-
run "GroupChat.java" as previous.
-
Type "Download" in chat room when you want to download file to a user.
-
choose "One to one file transfer" mode.
-
input receiver client ID.
-
input the path or the name of a file that you want to download.
-
If file is downloaded successfully, a message will be sent to chat room: (ClientID):Download_(fileName)from(uploaderID)
- Running instructions
- Running instructions
Haochi Bai – hb174@duke.edu