classification
Title: asyncore connect() and winsock errors
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: giampaolo.rodola Nosy List: giampaolo.rodola, intgr, josiahcarlson, klimkin
Priority: normal Keywords: patch

Created on 2002-12-26 18:25 by gvanrossum, last changed 2010-08-23 21:59 by giampaolo.rodola. This issue is now closed.

Files
File name Uploaded Description Edit
asyncore-winerrors.patch giampaolo.rodola, 2010-08-21 17:05
Messages (6)
msg13687 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-12-26 18:25
asyncore's connect() method should interpret the
winsock errors; these are different from Unix (and
different between the Win98 family and the Win2k family).
msg13688 - (view) Author: Alexey Klimkin (klimkin) Date: 2004-03-04 08:24
Logged In: YES 
user_id=410460

Patch #909005 fixes the problem.
msg13689 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2007-01-07 06:10
klimkin: Please explain how either of the versions of patch #909005 fix the problem.  From what I can tell, the only change you made was to move the accept() handling of errors to the handle_read() method.

Guido: In terms of winsock errors, which are actually raised on connection error between win98, win2k, and/or XP, 2003, and Vista?
msg13690 - (view) Author: Alexey Klimkin (klimkin) Date: 2007-01-08 20:59
Sorry, but 2 years ago we were developing this for Linux and XP only;). Even they say to be POSIX, they behave a little differently. As I remember, we have added handling of some E* return codes, which was appearing for non-blocking connect on XP. If you connect while in blocking state, you won't get those values.
msg114516 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-08-21 17:05
The only windows-related error on connect() should be EINVAL
From http://msdn.microsoft.com/en-us/library/ms737625 :

> WSAEALREADY
> A nonblocking connect call is in progress on the specified socket.

The same approach is adopted by Twisted which just returns in that case.
A patch is in attachment.
Assigning the issue to me as a reminder to commit the patch if no further comments are submitted in the next days.
msg114743 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-08-23 21:59
Fixed in r84284.
History
Date User Action Args
2010-08-23 21:59:13giampaolo.rodolasetstatus: open -> closed
resolution: fixed
messages: + msg114743
2010-08-21 17:10:29BreamoreBoysetstage: patch review
2010-08-21 17:06:03giampaolo.rodolasetstage: needs patch -> (no value)
2010-08-21 17:05:47giampaolo.rodolasetfiles: + asyncore-winerrors.patch
assignee: josiahcarlson -> giampaolo.rodola
messages: + msg114516

keywords: + patch
2010-08-17 23:59:13gvanrossumsetnosy: - gvanrossum
2010-08-17 22:51:35BreamoreBoysetstage: needs patch
type: behavior
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.3
2009-03-28 12:23:04intgrsetnosy: + intgr
2008-10-01 11:42:36giampaolo.rodolasetnosy: + giampaolo.rodola
2002-12-26 18:25:04gvanrossumcreate