Thanks <span class="gmail_quote"><span class="gmail_sendername">Adam Atlas & Arnar Birgisson, <br><br>But I want to receive binary data in my protocol. <br></span></span><br><div><span class="gmail_quote">On 7/9/07, <b class="gmail_sendername">
Adam Atlas</b> &lt;<a href="mailto:adam@atlas.st">adam@atlas.st</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>On 2 Jul 2007, at 
21.40, steven wang wrote:<br>&gt; I rewrite my source about MyProtocol. But I can not receive<br>&gt; complete data, only a part of data. :( Could you help me?<br><br>Have you taken a look at twisted.protocols.basic? There are some nice
<br>abstractions in there for building chunked protocols. I&#39;d recommend<br>NetstringReceiver if you want to keep your protocol text-based. You<br>subclass protocols.basic.NetstringReceiver instead of<br>protocol.Protocol
, and override stringReceived(data). That gets<br>called whenever a complete message is received (unlike dataReceived,<br>which just gets a series of bytes that may or may not be a complete<br>message).<br><br>_______________________________________________
<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br></blockquote></div><br>