mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
SF patch 555085 (timeout socket implementation) by Michael Gilfix.
I've made considerable changes to Michael's code, specifically to use the select() system call directly and to store the timeout as a C double instead of a Python object; internally, -1.0 (or anything negative) represents the None from the API. I'm not 100% sure that all corner cases are covered correctly, so please keep an eye on this. Next I'm going to try it Windows before Tim complains. No way is this a bugfix candidate. :-)
This commit is contained in:
parent
c9a55776c8
commit
67f7a38849
5 changed files with 689 additions and 122 deletions
|
@ -83,6 +83,9 @@ 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 */
|
||||
} PySocketSockObject;
|
||||
|
||||
/* --- C API ----------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue