Message87465
| Author |
josiahcarlson |
| Recipients |
MrJean1, alanmcintyre, donmez, facundobatista, giampaolo.rodola, josiahcarlson, mark.dickinson, r.david.murray |
| Date |
2009年05月08日.19:38:44 |
| SpamBayes Score |
1.8814413e-08 |
| Marked as misclassified |
No |
| Message-id |
<1241811526.66.0.0894277186359.issue5798@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Ok, so I was running "test_asyncore" and not "test_asynchat".
The issue on OS X is that when a new socket is connecting, select.poll()
shows the socket as being writable when it first connects, but using my
variant, .connected is False while it's waiting for the connection.
Options:
If we swap the pollin/pollout conditions, that would fix the hang on
mac, but cause the hang on others (I'm not really worried about not
doing a write after a read, .push() in asynchat performs an immediate
send).
If we get rid of the .connected check, then when a .read() fails and
causes a close, then we get an exception in handle_write().
If we swap to Giampaolo's variant, then we could lose data that was
legitimately sent by a client.
I've got a version that doesn't hang on OS X, and should work on all
platforms. It's ugly, but it works. |
|