Jean-Paul Calderone wrote:
On Mon, 02 Feb 2009 14:45:40 +0100, Johann Borck <johann.borck@densedata.com> wrote:
[snip] The correct way is to call conn.disconnect()/transport.loseConnection() in f1 instead of in cancel.
It's "correct" in that it works around the bug in Twisted. However, this *is* a bug in Twisted which should be fixed. Then it will be just as correct to do it one way as the other. I personally find it counterintuitive to have an open connection after an explicit call to disconnect, but assumed it is intended behavior since it's explicitly mentioned in the docstring. However for the given example I'd still say the above is the only correct way unless Atsuo intends to break the connection before the transfer has finished.
Johann