The following code represents a basic Peer-to-Peer file distribution framework
- You must run the tracker.py file The tracker file listens to incoming incoming connections TCP/UDP and behaves accordingly
python tracker.py
- Run Peer.py and make sure to change the name and port of each peer Note:
- You can run as many peers as you want.
- Peers hold chunks of files that are not found at the tracker
def Main():
peer = Peer({peer name} , portNumber={port Number})
peer.start()
python peer.py
- run app.py where you can request the files you want from the tracker.
python app.py