def removeConnectedChannel(self, channel): """ Remove the connected channel, and report the current number of open channels to the listening socket in the parent process. """ HTTPFactory.removeConnectedChannel(self, channel) self._report("-")
def testallConnectionsClosedWithConnectedChannels(self): """ allConnectionsClosed( ) should only fire after all connected channels have been removed """ self.callbackFired = False factory = HTTPFactory(None) factory.addConnectedChannel("A") factory.addConnectedChannel("B") factory.addConnectedChannel("C") factory.allConnectionsClosed().addCallback(self._callback) factory.removeConnectedChannel("A") self.assertFalse(self.callbackFired) # wait for it... factory.removeConnectedChannel("B") self.assertFalse(self.callbackFired) # wait for it... factory.removeConnectedChannel("C") self.assertTrue(self.callbackFired) # now!