[Twisted-Python] Strange behavior when transferring large strings

Gabriel Rossetti mailing_lists at evotex.ch
Thu Apr 24 05:40:40 MDT 2008


Maarten ter Huurne wrote:
> On Wednesday 23 April 2008, Gabriel Rossetti wrote:
>
>   
>> Ok, so apparently it (Twisted, Python, the OS?) can buffer and send up
>> to 16k, after that it splits the message up, thus this would explain the
>> lockup, since the app expects a whole XML message and can't process the
>> second part correctly.
>>     
>
> If you use an event-based XML parser (like something that implements SAX), 
> you can simply feed it the bytes as they come in from the network. The XML 
> tag nesting will tell you when the entire message has been received, which 
> is when you receive the "close tag" callback for the root tag.
>
> Bye,
> 		Maarten
>   
Yes, that's what I ended up doing :-) It works great! Thanks

Gabriel




More information about the Twisted-Python mailing list