GithubHelp home page GithubHelp logo

five-in-a-row-client-server's Introduction

five-in-a-row-client-server

An implementation of a five in a row game utilising a client/server architecture in Python.

Notes

  • Working directory (AKA ./) has been added to $PATH.
  • Developed on Ubuntu 20.04 in a WSL2 VM.
  • Tested locally. Your mileage may vary if running this across multiple machines.
  • Server disconnects all clients and shuts down if it does not receive a request within 15 seconds of handling its previous request.

Running

Note: These commands work on Ubuntu 20.04 with python3 and python3-pytest installed via apt. If they do not work for you try running python and pytest instead.

Server

python3 server

Client

python3 client

Tests

pytest-3

Known Issues

  • Using Pythons builtin input function blocks stdin until after the user has sent a command. I tried several solutions to this, with varying degrees of success.
    • Tried running client input and output on separate threads. Did not work as input was still blocking stdin.
    • Tried implementing a non-blocking method to read stdin. This saw some success, but was very inconsistent, and confusing to read.
  • If a client tries to disconnect after another client has already disconnected, and is the only client on the server, the server processes the disconnect command incorrectly, and does not not disconnect the client properly.

five-in-a-row-client-server's People

Watchers

James Cloos avatar Dylan King 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.