djacobs / PyAPNs

Python library for interacting with the Apple Push Notification service (APNs)
http://pypi.python.org/pypi/apns/
MIT License
1.22k stars 377 forks source link

Use poll() instead of select() if available #161

Open lnqs opened 8 years ago

lnqs commented 8 years ago

select() doesn't work with file-descriptiors > FD_SETSIZE, which is 1024 per default. In long-running processes that use a lot of FDs, this limit can be reached quickly, causing the calls to select() to fail.

poll() doesn't have this restriction, while it is available on most systems. Therefore, it is used over select() if possible. On systems where it isn't available (esp. older versions of windows), the code falls back to utilize select().