]> granicus.if.org Git - python/commit
Major overhaul of timeout sockets:
authorGuido van Rossum <guido@python.org>
Thu, 13 Jun 2002 15:07:44 +0000 (15:07 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 13 Jun 2002 15:07:44 +0000 (15:07 +0000)
commit11ba094957ed72d0ecc9e50e79d138a0770df6e3
tree029b200e2794fdb9231f42cc77d3120b81ac5c96
parentdfad1a9039df367c9a403e2b777fe2690f3b5b88
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.
Doc/lib/libsocket.tex
Lib/test/test_socket.py
Lib/test/test_timeout.py
Modules/socketmodule.c
Modules/socketmodule.h