[Twisted-Python] anyway to get data from a protocol instance?
wang wei
wgwigw at gmail.com
Wed Aug 9 02:43:19 MDT 2006
please have a look of fellow code.
from twisted.internet import reactor, protocol
class echo(protocol.Protocol):
def __init__(self):
from Queue import Queue
self.q = Queue()
def lineReceived(self, line):
self.q.put(line)
class echofactory(protocol.ServerFactory):
def buildProtocol(self, addr):
p = echo()
p.factory = self
return p
class runEcho:
def __init__(self):
a = echofactory()
reactor.listenTCP(1024, a)
reactor.run()
My question is how can I get size of Queue q from another class when the
program running.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20060809/e6eb92c1/attachment.html>
More information about the Twisted-Python
mailing list