[Twisted-Python] I am confused on transport.write and transport.writeSomeData
koder.chen.1984 at gmail.com
Mon Oct 11 10:58:22 EDT 2010
It works! In the original codes, I use 'write' directly in another
of the reactor thread, it seems that this caused the 'slow' problem. Now, I
have changed to use reactor.callFromThread, and it works fine till now.
On Sat, Oct 9, 2010 at 8:07 PM, <exarkun at twistedmatrix.com> wrote:
> On 09:16 am, koder.chen.1984 at gmail.com wrote:
>>It seems that, when use "self.transport.write" in the protocol
>>it will buffer the content for a long time before it actually send it
>>when the size of content is big, is there a 'flush' like method that I
>>can do the
> There's no more buffering than is necessary. If your data isn't sent
> pretty quickly, then you're doing something wrong. For example, perhaps
> you're calling transport.write from a non-reactor thread? Or in a
> never-ending loop?
>>And when use 'self.transport.writeSomeData', if the size of content to
>>be sent is
>>large, it will not be able to send anything. What is the strategy to
> Don't ever call transport.writeSomeData. It will do something
> arbitrarily wrong.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python