[ python-Bugs-805194 ] Inappropriate error received using socket
timeout
SourceForge.net
noreply at sourceforge.net
Wed Jun 2 04:51:11 EDT 2004
Bugs item #805194, was opened at 2003-09-12 18:56
Message generated for change (Comment added) made by troels
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=805194&group_id=5470
Category: Windows
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Popov (evgeni_popov)
Assigned to: Nobody/Anonymous (nobody)
Summary: Inappropriate error received using socket timeout
Initial Comment:
When using the timeout option with a socket object
(python 2.3), I don't have the same behaviour under
Windows than under Linux / Mac.
Specifically, if trying to connect to an unopened port of
the localhost, I get a timeout exception on Windows
(tested under W2K Server), whereas I get a "111 -
Connection Refused" exception on Linux and "22 - Invalid
Argument" on Mac (OS X).
Even if the error message under Mac is not really
appropriate (someone said to me he got the
right 'Connection Refused' on his MAC), I think that the
behaviour under Linux and Mac is the right one, in that it
sends (quickly) an error message and not timeouting.
Note that when using blocking socket the behaviour is
ok under all platforms: they each return back quickly
a "Connection refused" error message (err codes are
different depending on the platform (61=Mac,
111=Linux, 10061=Windows)). FYI, I don't use firewall or
similar prog on my windows box (but that should not
matter, because it does work in blocking mode, so that
can't be a firewall problem).
I heard that the timeout option was implemented based
on Timothy O'Malley timeoutsocket.py. Then, maybe the
pb can come from the usage of select in the connection
function: select is not asked to get back exceptions in
the returned triple, whereas I think some errors can be
returned back through this mean under Windows
(according to Tip 25 of Jon C. Snader book's "Effective
TCP/IP Programming"). So, by not checking the returned
exceptions, we would miss the "connection refused"
error and get instead the timeout error...
----------------------------------------------------------------------
Comment By: Troels Walsted Hansen (troels)
Date: 2004-06-02 10:51
Message:
Logged In: YES
user_id=32863
The Windows part of this bug is a duplicate of bug #777597.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=805194&group_id=5470
More information about the Python-bugs-list
mailing list