[Twisted-Python] Noob Question

Shelby Ramsey sicfslist at gmail.com
Sat Mar 14 17:12:49 EDT 2009


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

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]

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

Should something along those lines work?

David / Peter ... thanks again for the assistance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090314/2b90fd9a/attachment.htm 

More information about the Twisted-Python mailing list