[Twisted-Python] Noob Question

Shelby Ramsey sicfslist at gmail.com
Sat Mar 14 15:12:49 MDT 2009


Peter,

Thanks for the help.  Yes I get a header and then am looking to extract the
body.

So to make sure I understand:

p = compile('Content-Length:\s(\d+)')

class SomeClient(basic.LineReceiver):
    def connectionMade(self):
        self.transport.write('login: info\r\n\r\n') # log in ... then device
starts sending events

    def lineReceived(self, line):
        m = p.findall(line)
        if m:
            self.body_length = m[0]
            self.setRawMode()

     def rawDataReceived(self, data):
         self.get_rest -= len(data)
         set.lineMode()

Should something along those lines work?

David / Peter ... thanks again for the assistance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20090314/2b90fd9a/attachment.html>


More information about the Twisted-Python mailing list