A shared whiteboard that allows multiple users to draw at the same time.
Java, Socket, Thread
- Allow multiple people to draw (free draw, line, triangle, rectangle, circle, words) at the same time.
- Enable users to chat in the chat room.
- Administrator function. The user needs to have approval from the administrator to enter the shared whiteboard room. The administrator can kick out any user at ant time.
- This project uses a hybrid model that combines the client-server architecture and the P2P architecture. Client-server architecture is used when users get approval from the administrator. P2P architecture is used to send users' drawings to other users. Please notice that the server used in this project is 2c4g (2 cores, 4G RAM), which is weaker than most PCs. Therefore, we choose the P2P for drawing sharing.
- The TCP socket used in this project is request-based rather than connection-based. The request-based socket means that the sockets are created every time there is a request. For example, the user will build a socket to send a request to the server, and the socket is closed once the request is finished. The socket connection will not last long. We assume that the frequency of message passing, including user list updates, whiteboard synchronization, and other operations, is low. Users are idle most of the time. Under this presumption, it will be unwise to hold the socket connection to waste system resources waiting for information.
- Source code:
In folder /Shared-Whiteboard-main
How to compile: mvn clean package
How to execute:
- java -jar target/server-jar-with-dependencies.jar
- java -jar target/client-jar-with-dependencies.jar $username 3200 $serverIP $userPort. e.g. java -jar target/client-jar-with-dependencies.jar admin 3200 localhost 3201
- Jar files: In folder JAR_files
- Report: DS report2.pdf