I decided to change the interaction between setblocking() and

settimeout().   Already, settimeout() canceled non-blocking mode; now,
setblocking() also cancels the timeout.  This is easier to document.

(XXX should settimeout(0) be an alias for setblocking(0)?  They seem
to have roughly the same effect.  Also, I'm not sure that the code in
connect() and accept() is correct in all cases.  We'll sort this out
soon enough.)
This commit is contained in:
Guido van Rossum 2002-06-07 03:36:20 +00:00
parent 96803b2983
commit e8008f0013

View file

@ -1086,11 +1086,8 @@ sock_setblocking(PySocketSockObject *s, PyObject *arg)
return NULL; return NULL;
s->sock_blocking = block; s->sock_blocking = block;
s->sock_timeout = -1.0; /* Always clear the timeout */
/* If we're not using timeouts, actually set the blocking to give internal_setblocking(s, block);
old python behavior. */
if (s->sock_timeout < 0.0)
internal_setblocking(s, block);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;