[Twisted-Python] twisted, nc and LineReceiver

Alexandre Fayolle alexandre.fayolle at free.fr
Thu Nov 7 03:15:11 EST 2002


> > Sounds like a CRLF versus CR issue.  Have you checked for that? :-)
> 
> Indeed. Netcat sends only \n, not \r. See the `delimiter' attribute of
> the LineReceiver class.

Ahaaa!

Thanks for the quick answer. I've attached a patchlet adding this little
piece of information to the LineReceiver's docstring, so that the epydoc
documentation will provide the tip. 
 

-- 
Alexandre
-------------- next part --------------
--- /usr/lib/python2.2/site-packages/twisted/protocols/basic.py	2002-09-23 10:51:29.000000000 +0200
+++ basic.py	2002-11-07 09:05:47.000000000 +0100
@@ -131,6 +131,10 @@
     Each line that's received becomes a callback to lineReceived.  Each
     chunk of raw data becomes a callback to rawDataReceived.
 
+    Lines are limited to 16384 bytes. Change the 'MAX_LENGTH' class attribute
+    if you wish to receive longer lines. The default line delimiter is '\r\n'
+    and it is set by the 'delimiter' class attribute.
+
     This is useful for line-oriented protocols such as IRC, HTTP, POP,
     etc.
     """
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 241 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20021107/896643ed/attachment.pgp 


More information about the Twisted-Python mailing list