def __init__(self, src, dst, conn): self.src, self.dst = src, dst self.conn = conn self.done = False self.p = Promise() self.count = 0 self.burst = True conn.conn._on('writable', self.copy) conn.conn._on('close', self.closed) schedule(self.copy)
def copyagain(self, r): self.burst = True schedule(self.copy)