Here's a patch to convert socketmodule to use poll() for the timeout handling. ifdefs and includes have been copied from selectmodule, so I believe they should be correct for all platforms. Compiled and tested on Linux (RH73).
Logged In: YES user_id=21627 While the patch is good as it stands, it is also incomplete: If poll(2) is not available, it might still overrun the FD_SETSIZE. I think there should be another return value from internal_select (-1), indicating an internal error. A Python RuntimeError should be set in this case. Callers should check for -1, and return immediately. Are you willing to extend the patch in that direction?
Logged In: YES user_id=32863 You're right, however I think that it is a very minor problem compared to the current situation. All major UNIX platforms support poll(2) in my experience. The only important Python platform without poll is Windows, and it doesn't have the FD_SETSIZE problem. Thus I think the patch should be applied as it stands, but the original bug ticket can be left open for another enterprising individual to make the changes you suggest. I'm afraid that work commitments prevent me from being that individual for the foreseeable future...