[Twisted-Python] LineReceiver and setRawMode()

jarrod roberson jarrod at vertigrated.com
Thu Sep 7 13:01:12 EDT 2006

I got a simple line protocol I am trying to implement, blocks .

CMD <byte count>\r\n

when CMD 5\r\n

is received, I setRawMode()
and then inside of rawDataReceived() handle the blob

the problem is when my client sends the data and the next CMD line
gets eaten by the rawDataReceived() call before I can set it back to

so for something like

CMD 5\r\n
CMD 10\r\n

after I get CMD 5\r\n

inside rawDataReceived(data)
data = abcdeCMD 10\r\n

is there something in twisted that will help with this?
or do I need to subclass LineReceiver and add a
setRawMode(bytesToRead) or something?

More information about the Twisted-Python mailing list