[Twisted-Python] ProducerConsumerProxy problem

Haris Andrianakis tlogic at gmail.com
Sun Apr 30 10:17:43 EDT 2006


I'm trying to setup a ProducerConsumerProxy between a
protocols.basic.FileSender producer and a TCP Protocol transport.
I have the following code:

fileObj = file('test.txt','r')
proxy = protocols.pcp.ProducerConsumerProxy(self.transport)
producer = protocols.basic.FileSender()
dd = producer.beginFileTransfer(fileObj, proxy)
proxy.registerProducer(producer, False)

The problem is that only 16KB of data are transfered and then the
transfer pauses. Also if I use BasicProducerConsumerProxy no data at
all gets transfered. I think that the proxy doesn't call resumeProducing()
the FileSender producer and thats why the transfer seems to halt.

Any suggestions ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20060430/57094efa/attachment.htm 

More information about the Twisted-Python mailing list