Sign inSign up

arguellj/chat

By arguellj

•Updated almost 9 years ago

Chat server built in Java 8 and Maven 3.5.2

Image
0

10K+

arguellj/chat repository overview

⁠Chat Server Task

⁠Summary

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⁠.

⁠How do I get set up

⁠Application Dependencies

The project is built in Java 8. It uses Maven⁠ as project management tool. The following dependencies are included using Maven:

⁠Environment Dependencies
⁠How to compile and run

The project can be compiled and run in two ways, locally or by using Docker. The following sections described these alternatives.

⁠Compile and run locally

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

⁠Compile and run with Docker

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.

⁠FAQ

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⁠.

⁠Who do I talk to

  • Jeancarlo Arguello Calvo - [email protected]⁠
  • StudentID: 17307291
  • Trinity College Dublin, The University of Dublin

Tag summary

Content type

Image

Digest

Size

93.1 MB

Last updated

almost 9 years ago

docker pull arguellj/chat