[Twisted-Python] How to receive a big stream data?

steven wang steven.zdwang at gmail.com
Mon Jul 9 00:31:27 MDT 2007


Thanks Adam Atlas & Arnar Birgisson,

But I want to receive binary data in my protocol.

On 7/9/07, Adam Atlas <adam at atlas.st> wrote:
>
>
> On 2 Jul 2007, at 21.40, steven wang wrote:
> > I rewrite my source about MyProtocol. But I can not receive
> > complete data, only a part of data. :( Could you help me?
>
> Have you taken a look at twisted.protocols.basic? There are some nice
> abstractions in there for building chunked protocols. I'd recommend
> NetstringReceiver if you want to keep your protocol text-based. You
> subclass protocols.basic.NetstringReceiver instead of
> protocol.Protocol, and override stringReceived(data). That gets
> called whenever a complete message is received (unlike dataReceived,
> which just gets a series of bytes that may or may not be a complete
> message).
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20070709/2d344c0a/attachment.html>


More information about the Twisted-Python mailing list