[Twisted-Python] How to receive a big stream data?
steven.zdwang at gmail.com
Mon Jul 9 02:31:27 EDT 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
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python