Message146653
> While writing the test case, I found out that the test case does not
> fail before the patch. It seems that draining the output buffer
> already works:
>
> The attached script 'asyncore_shutdown.py' drains the output buffer
> when run without the patch, with Python 3.2, and prints 'Done.'. The
> dispatcher_with_send handle_close() method is never called.
That's because you didn't define a handle_read() method: since you
never read from the socket, you don't detect EOF, and never call
handle_close():
Try with this:
"""
print('Done.')
self.close()
+ def handle_read(self):
+ self.recv(MSG_SIZE)
+
def handle_close(self):
print('calling handle_close')
asyncore.dispatcher_with_send.handle_close(self)
"""
And it'll fail ;-) |
|
Date |
User |
Action |
Args |
2011-10-30 18:43:24 | neologix | set | recipients:
+ neologix, xdegaye, François-Xavier.Bourlet |
2011-10-30 18:43:24 | neologix | link | issue12498 messages |
2011-10-30 18:43:24 | neologix | create | |
|