Message146618
> Actually the class asyncore.dispatcher_with_send do not handle
> properly disconnection. When the endpoint shutdown his sending part
> of the socket, but keep the socket open in reading, the current
> implementation of dispatcher_with_send will close the socket without
> sending pending data.
>
> Adding this method to the class fix the problem:
>
> def handle_close(self):
> if not self.writable():
> dispatcher.close()
This does not seem to work. The attached Python 3.2 script
'asyncore_12498.py' goes into an infinite loop of calls to
handle_read/handle_close when handle_close is defined as above. In
this script the Writer sends a 4096 bytes message when connected, the
Reader reads only 64 bytes and closes the connection afterwards. Then
follows the sequence:
select() returns a read event handled by handle_read()
handle_read() calls recv()
socket.recv() returns 0 to indicate a closed connection
recv() calls handle_close
This sequence is repeated forever in asyncore.loop() since out_buffer
is never empty.
Note that after the first 'handle_close' has been printed, there are
no 'handle_write' printed, which indicates that the operating system
(here linux) states that the socket is not writable. |
|
Date |
User |
Action |
Args |
2011-10-29 19:32:13 | xdegaye | set | recipients:
+ xdegaye, neologix, François-Xavier.Bourlet |
2011-10-29 19:32:13 | xdegaye | set | messageid: <1319916733.54.0.962280734185.issue12498@psf.upfronthosting.co.za> |
2011-10-29 19:32:12 | xdegaye | link | issue12498 messages |
2011-10-29 19:32:12 | xdegaye | create | |
|