Coder Social home page Coder Social logo

pysensornet's Introduction

PyTorrent

Python application


Installation

This project uses Pipenv for dependency and virtual environment management, more about Pipenv can be found here.

Python : 3.8
Tested OS: Ubuntu 20.04 LTS GNU Make: 4.2.1

  1. Make sure Python and pip are already installed. Then run the following through pip in the terminal:
    pip install --user pipenv Make sure pipenv is available on PATH if using the --user option.

    Alternatively, you can use pipx to create an isolated environment to use pipenv. pip install --user pipx python3 -m pipx ensurepath to ensure pipx is on path. pipx install pipenv

  2. After Pipenv has been installed run the following command in terminal to install the dependencies for this project:
    make install

  3. (Optional) Install Xterm to use the multi client launcher. Xterm can be installed using the following commands:
    sudo apt-get update -y
    sudo apt-get install -y xterm

  4. Before running the project, the files and client configs have to be generated. This can be done through by running
    make build This checks if all the configs and files have been generated correctly.


Usage

Server usage

  • To start the main server, run the following command:
    make server

  • After the server init is complete, it will accept new connection requests.

Client usage

  • (Xterm required) Multiple clients: Multiple clients can be started by running the following command
    make clients
    Then the client numbers to be started should be entered with a space in between. This will open a new xterm window for each client.
  • Single Client: A single client can be started in the same terminal window by isnig the following command
    make client
    This will by default start up client 1. To specify the client number to start up, the client number can be specified in the following way
    make client client_no=3

Clean repo

To clean the temporary files in the repository like logs, configs etc., use the following command
make clean

pysensornet's People

Contributors

arunj18 avatar jada4569 avatar arunj20 avatar

Watchers

James Cloos avatar Stephen avatar  avatar

pysensornet's Issues

Client code

  • Load config from file
  • Contact server and let the server know you are online. Quit if cannot connect to the server
  • Main thread keeps running to get user input, server thread to get client file requests (print to court if possible about request)
  • Get file option, contact server to get the file from peers. if no peer has the file, let the user know and handle it.
  • Quit option, finish all pending file transfers, send message to the server and quit gracefully.

Server code

  • Load config for server from a file
  • Keep server running (maybe even log connections)
  • Server keeps a record of which files each client has and the client which has the oldest version.
  • Server quit option - sends quit message to all clients and end clients execution

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.