classification
Title: asyncore.close_all() should call x.handle_close() instead of x.close()
Type: behavior Stage: test needed
Components: Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: giampaolo.rodola, me.myself, r.david.murray
Priority: normal Keywords:

Created on 2010-07-29 10:55 by me.myself, last changed 2010-08-03 21:36 by giampaolo.rodola. This issue is now closed.

Messages (3)
msg111908 - (view) Author: me myself (me.myself) Date: 2010-07-29 10:55
Title says it all.
msg111937 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-07-29 14:27
No it doesn't.  Why do you think this change should be made?  What bug does it produce in it's current form?  Can you provide a unit test demonstrating the buggy behavior?
msg112693 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-08-03 21:36
No, it shouldn't.

handle_close() is more like a callback method called by asyncore itself when the connection is about to be closed "cleanly", and it's not supposed to be called directly by the user (see for example how recv() and send() methods are implemented and issue 1740572).
Also it is usually overridden and filled with application code you hardly want to be executed when you just want to close all connections at once.

When you use close_all() you just want to abruptly close all existing connections, without even caring about pending data waiting to be read or written, hence close() must be called.

Closing out as won't fix as long as some actual reason to change the current behavior is provided.
History
Date User Action Args
2010-08-03 21:36:55giampaolo.rodolasetstatus: open -> closed
resolution: wont fix
messages: + msg112693
2010-07-29 14:27:28r.david.murraysetnosy: + r.david.murray

messages: + msg111937
stage: test needed
2010-07-29 11:03:09pitrousetnosy: + giampaolo.rodola

versions: + Python 2.7, Python 3.2
2010-07-29 10:55:20me.myselfcreate