This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andzn
Recipients David Hirschfeld, andzn, asvetlov, desbma, eryksun, paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-06-10.12:30:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560169826.14.0.00627691287503.issue28708@roundup.psfhosted.org>
In-reply-to
Content
I have updated PR 13842(https://github.com/python/cpython/pull/13842) to dynamically alocate the fd_sets on windows.

I did some testing on windows with the following two paterns:
1. 10000 transient clients: (open connection, send message, close connection)
2. 1024 permanent clients: (open connection, then in infinite loop: (read message, send message back))

Everything seemed to be fine.

I didn't do any testing on Linux.

On windows I also had to remove the if that vstinner added to check if the greatest file descriptor is greater than the setsize. That condition always failed for me on Windows. Apparently, according to: https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-select, windows ignores nfds and "is included only for compatibility with Berkeley sockets." The documentation also states that the FD_ "macros are compatible with those used in the Berkeley software, but the underlying representation is completely different.", and: "Internally, socket handles in an fd_set structure are not represented as bit flags as in Berkeley Unix. Their data representation is opaque."

This is why I chose to determine setsize based on the inputs. If you think that's not going to work, please say why :)
History
Date User Action Args
2019-06-10 12:30:26andznsetrecipients: + andzn, paul.moore, pitrou, vstinner, tim.golden, asvetlov, zach.ware, desbma, eryksun, steve.dower, David Hirschfeld
2019-06-10 12:30:26andznsetmessageid: <1560169826.14.0.00627691287503.issue28708@roundup.psfhosted.org>
2019-06-10 12:30:26andznlinkissue28708 messages
2019-06-10 12:30:25andzncreate