[Twisted-Python] anyway to get data from a protocol instance?
9 Aug
2006
9 Aug
'06
3:43 a.m.
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.
6441
Age (days ago)
6441
Last active (days ago)
3 comments
3 participants
participants (3)
-
Jean-Paul Calderone
-
Torsten Irländer
-
wang wei