GithubHelp home page GithubHelp logo

mac0352-ep2's Introduction

Tic Tac Toe - MAC0352-EP2

Tic tac toe game over the internet.

Second project for MAC0352 - Computer Networks and Distributed Systems.

Build and Run

Docker Compose:

The necessary dependencies required to run this project are:

Also, it is required that your host is able to access the docker network bridge as the database and the server are deployed there. This network is useful so we can assign IP addresses to the containers. It can be inspected like this:

docker inspect network bridge

If you have docker installed, and you are using a Linux environment, it is almost certain that this network is running and available.

The easiest way to run the server and the database is to run:

make run

It makes sure to run the server, the database and the database volume so the data is kept even if the database is killed.

Notice that this system assumes that the IPs 172.17.0.2 and 172.17.0.3 are available for use of the database and the server respectively. In case they aren't, the server won't be able to run.

After running, you can check if everything is ok by checking if the containers are up:

docker-compose ps

And also by checking the server logs:

docker logs -f mac0352-ep2_server_1

Observations about Mac

There is no docker0 bridge on macOS. Because of the way networking is implemented in Docker Desktop for Mac, you cannot see a docker0 interface on the host. This interface is actually within the virtual machine.

Thus, it is a known Docker for Mac issue that the the docker (Linux) bridge network is not reachable from the macOS host and Docker Desktop for Mac can’t route traffic to containers.

Basically, this means that this EP won't work out of the box on MacOS environments.

Running clients

To run a TCP client, run the following:

make run-client-docker-tcp-interactive

Or UDP:

make run-client-docker-udp-interactive

Note that you cannot run multiple client applications in the same machine. This is because it listens to opponent's connection in a constant port. Running with the make commands above will use different docker subnet's IPs, that can access the server and also run in bridge's IPs.

Cleaning

To kill the server and the database:

make shutdown

To kill everything (including the database volume):

make remove-all

Test

make test

mac0352-ep2's People

Contributors

jaehnri avatar lucadillenburg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.