[Twisted-Python] Problem about Multithread

Itamar Turner-Trauring itamar at itamarst.org
Sat Mar 17 21:05:37 EDT 2012

On 03/17/2012 09:01 PM, hz hanks wrote:
> Hi, All
> I just started Twisted and I've a problem when using it. I want to
> write a program for both the client and the server that the client can
> download something from the server. Therefore, I want every client and
> server pair can use multithread to download the different parts of the
> files at the same time in order to increase the download speed. But I
> just know how to send simple message between server and client, such
> as protocol.Protocol.dataReceived. Any one can give me some advice.
> Very appreciated!

You don't need multiple threads to do multiple network operations (e.g. 
parallel downloads) in Twisted. Just run multiple client requests, e.g. 
by calling reactor.connectTCP multiple times.

More information about the Twisted-Python mailing list