I am working on writing a Python client for Direct Connect P2P networks. In fact, it works by connecting to a central server and responding to other users who are looking for files.
Sometimes another client will ask us to connect to them, and they can start downloading the file from us. This is a direct connection to another client and does not go through the central server.
What is the best way to handle these connections with other clients? Currently, I use one Twisted reactor to connect to the server, but is it better to have several reactors, one for each client, each of them working in a different thread? Or would it be better to have a completely separate Python script that performs a connection to the client?
If there is another solution that I donβt know about, I would like to hear it. I am new to Twisted programming, so I am open to suggestions and other resources.
Thank!
source
share