homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients giampaolo.rodola, josiah.carlson, josiahcarlson, shigin
Date 2008年05月24日.18:25:48
SpamBayes Score 0.011051689
Marked as misclassified No
Message-id <1211653572.13.0.000355699959106.issue2944@psf.upfronthosting.co.za>
In-reply-to
Content
By trying your script on Linux and Windows I notice different behaviors.
On Windows handle_expt is always called.
On Linux, no matter if using select or poll, handle_accept is called,
then an exception is thrown at the time the data is going to be sent:
Traceback (most recent call last):
 File "index.py", line 34, in <module>
 test()
 File "index.py", line 31, in test
 asyncore.loop(use_poll=1)
 File "/usr/lib/python2.5/asyncore.py", line 205, in loop
 poll_fun(timeout, map)
 File "/usr/lib/python2.5/asyncore.py", line 190, in poll2
 readwrite(obj, flags)
 File "/usr/lib/python2.5/asyncore.py", line 101, in readwrite
 obj.handle_error()
 File "/usr/lib/python2.5/asyncore.py", line 93, in readwrite
 obj.handle_read_event()
 File "/usr/lib/python2.5/asyncore.py", line 400, in handle_read_event
 self.handle_connect()
 File "index.py", line 17, in handle_connect
 self.send("hello world")
 File "/usr/lib/python2.5/asyncore.py", line 481, in send
 self.initiate_send()
 File "/usr/lib/python2.5/asyncore.py", line 468, in initiate_send
 num_sent = dispatcher.send(self, self.out_buffer[:512])
 File "/usr/lib/python2.5/asyncore.py", line 345, in send
 result = self.socket.send(data)
socket.error: (111, 'Connection refused')
In my opinion both behaviors are wrong since neither handle_expt nor
handle_connect should be called in case of a "connection refused" event.
Especially handle_connect should not be called at all since no
connection takes place.
The correct behavior here must be identifying when such event occurs,
raise the proper exception (ECONNREFUSED) and let it propagate until
handle_error which will take care of it.
History
Date User Action Args
2008年05月24日 18:26:13giampaolo.rodolasetspambayes_score: 0.0110517 -> 0.011051689
recipients: + giampaolo.rodola, josiahcarlson, josiah.carlson, shigin
2008年05月24日 18:26:12giampaolo.rodolasetspambayes_score: 0.0110517 -> 0.0110517
messageid: <1211653572.13.0.000355699959106.issue2944@psf.upfronthosting.co.za>
2008年05月24日 18:26:10giampaolo.rodolalinkissue2944 messages
2008年05月24日 18:26:06giampaolo.rodolacreate

AltStyle によって変換されたページ (->オリジナル) /