A quick glance over twisted/protocols/ftp.py indicates to me that nowhere is loseConnection actually called on a Port. Where is it supposed to be? (And what's up with storing it as DTPLoseConnection? I never see that being used...) On my machine, at least, calling loseConnection on a Port *would* indeed cause it to blow up :)
No, it was just a test. Calling DTPLoseConnection actually would remove the server since it would call Port.loseConnection, though trigging some unwanted effects. I don't remember the details so don't mind. :) The port is created in FTP.createPassiveServer, and loseConnection is called in DTP.finishGet (or DTP.finish, I don't think I've commited the namechange). Are you sure you get a (Port n closed) on the log? Here they are all shown (successive) first when I shut down. BTW, The point with my last reply was that I can't see that some of the code changed are ever run, and that makes it hard to test ;) // phed