[Twisted-Python] Re: [Twisted-commits] r17913 - Merge forward

22 Aug
2006
22 Aug
'06
7:55 a.m.
On Tue, 22 Aug 2006 01:10:46 -0600, Jonathan Lange jml@wolfwood.twistedmatrix.com wrote:
Modified: branches/cleantests-1883-2/twisted/web/test/test_distrib.py
--- branches/cleantests-1883-2/twisted/web/test/test_distrib.py (original) +++ branches/cleantests-1883-2/twisted/web/test/test_distrib.py Tue Aug 22 01:10:44 2006 @@ -15,16 +15,37 @@ self.logFile.close() del self.logFile
+def fireOnClose(protocol):
- d = defer.Deferred()
- oldConnectionLost = protocol.connectionLost
- def connectionLost(*a):
oldConnectionLost(*a)
d.callback(None)
- protocol.connectionLost = connectionLost
- return d
+class PBServerFactory(pb.PBServerFactory):
- onClose = None
- def buildProtocol(self, addr):
proto = pb.PBServerFactory.buildProtocol(self, addr)
self.onClose = fireOnClose(proto)
return proto
Would it make sense to use notifyOnDisconnect here, instead of all this custom scaffolding?
Jean-Paul
6064
Age (days ago)
6064
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jean-Paul Calderone