[Twisted-Python] Strange behavior when transferring large strings
Maarten ter Huurne
maarten at treewalker.org
Wed Apr 23 08:02:37 MDT 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/twisted-python/attachments/20080423/b85b53be/attachment.sig>
More information about the Twisted-Python
mailing list