[Twisted-Python] ProducerConsumerProxy problem

Haris Andrianakis tlogic at gmail.com
Sun Apr 30 08:17:43 MDT 2006


Hi,

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)
dd.addCallback(self.uploadDone)
dd.addErrback(self.uploadError)
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()
on
the FileSender producer and thats why the transfer seems to halt.

Any suggestions ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20060430/57094efa/attachment.html>


More information about the Twisted-Python mailing list