/PySocketRelay

Socket message relayer simulator using Docker and Python API Socket

Primary LanguagePythonMIT LicenseMIT

[PySocketRelay]

Description

Message relayer using python socket API and Docker network

How it works

2 Entities: Peer(Socket server instance, Socket client instance ) and Tracker diagram

Peers

  • Each peer have a socket server instance to receive connection and client instance to connect
  • A peer root send a message and other peers in the list relay the message to the next in the list

Tracker

  • Receive a peer(socket client instance connection and peer(server, client) info message), disconnect and add to peers' list. 'List' connect the peer to the server of last peer on the list
  • First retangle in the image example

Docker Network

TODO

Getting started

temp:

  cd simulators/tracker
  export PYTHONPATH=../../:$PYTHONPATH
  python3 Tracker.py
  cd simulators/root
  export PYTHONPATH=../../:$PYTHONPATH
  python3 PeerRoot.py
  cd simulators/relay
  export PYTHONPATH=../../:$PYTHONPATH
  python3 PeerRelayer.py

My Specifications

  • Podman 4.3.1
  • Python 3.11.2

License

MIT