Chat server built in Java 8 and Maven 3.5.2
10K+
This is the first assignment for the module CS4400-Scalable Computing for the Master in Science of Computer Science at Trinity College Dublin.
The Chat Server implements TCP sockets to handle multiple simultaneous clients. It follows the protocol described in Chat Server Task Description.
The project is built in Java 8. It uses Maven as project management tool. The following dependencies are included using Maven:
Maven. If the build and execution are done locally. More information in section Compile and run locally.
Docker. If the build and execution are done by using Docker. More information in section Compile and run with Docker.
The project can be compiled and run in two ways, locally or by using Docker. The following sections described these alternatives.
In order to run the project, it has to be compiled by using Maven with the following command:
mvn package
then, to execute it use the command:
java -cp target/chat-server-1.0-SNAPSHOT.jar chatserver.Main [port] [ipAddres] #ipAddress is optional
The application receives the number of the port as required argument and the ipAddress as optional argument.
The specified port will be used by the chat server socket to listen incoming connections.
If not ipAddress is given, the application will try to get the local IP of the machine. However, due to a machine has multiple network interfaces, there is not guarantee that it will give a IP address rather than 127.0.0.1 (localhost). Therefore, it is recommended to supply the IP address as argument.
Also, you can use the scripts compile.sh and start.sh for compile and run the project respectively.
The script start.sh receives the number of the port as required argument and the ipAddress as optional argument. The behavior of these arguments is the same as the command above to execute the application.
./start.sh [port] [ipAddress] #ipAddress is optional
In order to run the project, it has to be compiled by using Maven with the following command:
./compile-with-docker
then, to execute it use the command:
./start-with-docker.sh [port] [ipAddress] #ipAddress is optional
The application receives the number of the port as required argument and the ipAddress as optional argument.
The specified port will be used by the chat server socket to listen incoming connections.
If not ipAddress is given, the application will try to get the local IP of the machine. However, due to a machine has multiple network interfaces, there is not guarantee that it will give a IP address rather than 127.0.0.1 (localhost). Therefore, it is recommended to supply the IP address as argument.
Q. Which Maven version was used to build the project?
A: Maven 3.5.2
Q. How do I install Maven?
A: Please follow the steps mentioned in Maven Installation Guide.
Q. I get error message: Permission denied when try to run any script.
A: Execute in the terminal console:
chmod 755 start.sh compile.sh or chmod 755 start-with-docker.sh compile-with-docker.sh
Q. What does contain the Docker image?
A: It contains a lightweight linux distribution called alpine. The docker image used contains the JDK 8 and Maven 3.5.2, which are the dependencies of the applications. Then, Maven takes care of the specific dependencies of the application mentioned in the Application Dependencies Section.
Content type
Image
Digest
Size
93.1 MB
Last updated
almost 9 years ago
docker pull arguellj/chat