'Pump until there is no more input or output or until L{stop} is called.
This does not run any timers, so don\'t use it with any code that calls
reactor.callLater.'

def flush(self):

    self._stop = False
    timeout = (time.time() + 5)
    while ((not self._stop) and self.pump()):
        if (time.time() > timeout):
            return
