summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-06-13 15:07:44 +0000
committerGuido van Rossum <guido@python.org>2002-06-13 15:07:44 +0000
commit0cb67fbfc3c6a12a48ce018342ddf7d94084496d (patch)
tree6208f52c17de4c26a377797a72440434713bca3e /Modules/socketmodule.h
parent9d7f4a56656f090a331616a4fde59165e5f343e8 (diff)
downloadcpython-0cb67fbfc3c6a12a48ce018342ddf7d94084496d.tar.gz
Major overhaul of timeout sockets:
- setblocking(0) and settimeout(0) are now equivalent, and ditto for setblocking(1) and settimeout(None). - Don't raise an exception from internal_select(); let the final call report the error (this means you will get an EAGAIN error instead of an ETIMEDOUT error -- I don't care). - Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets, so other theads can run (this was a bug in the original code). - Redid the retry logic in connect() and connect_ex() to avoid masking errors. This probably doesn't work for Windows yet; I'll fix that next. It may also fail on other platforms, depending on what retrying a connect does; I need help with this. - Get rid of the retry logic in accept(). I don't think it was needed at all. But I may be wrong.
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r--Modules/socketmodule.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 0c6cd1b1ec..936acac5b9 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -83,9 +83,8 @@ typedef struct {
PyObject *(*errorhandler)(void); /* Error handler; checks
errno, returns NULL and
sets a Python exception */
- int sock_blocking; /* Flag indicated whether the
- socket is in blocking mode */
- double sock_timeout; /* Operation timeout value */
+ double sock_timeout; /* Operation timeout in seconds;
+ 0.0 means non-blocking */
} PySocketSockObject;
/* --- C API ----------------------------------------------------*/