'Write the application data in chunks to the wire.
The cached data is sent over the wire in chunks.  After every write
call, control is given back to the Twisted reactor so it has a chance
to flush the data.  Shortly thereafter, this function is called again
to write the next chunk of data.  The delays in between subsequent
write calls are controlled by the inter-arrival time obfuscator.'

def flushPieces(self):

    if (len(self.choppingBuf) > const.MTU):
        self.circuit.downstream.write(self.choppingBuf.read(const.MTU))
    else:
        blurb = self.choppingBuf.read()
        padBlurb = self.pktMorpher.getPadding(self.sendCrypter, self.sendHMAC, len(blurb))
        self.circuit.downstream.write((blurb + padBlurb))
        return
    reactor.callLater(self.iatMorpher.randomSample(), self.flushPieces)
