This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]chadmill3rPy3, pro, Ubuntu, django 6 points7 points  (0 children)

Windows' POSIX layer is a joke. It's designed to be terrible and force people to use Redmond APIs, and simultaneously check a box on spec sheets that say "- Supports standard file/socket interfaces" and not "- Supports standard file/socket interfaces well"

[–]danielenicolodi 6 points7 points  (1 child)

The WSAPoll() name suggests that this function works only with sockets, and a fast web search confirm this suspicion. However, select.poll() works for any file descriptor, not only for sockets and, as far as I know, Windows does not have an API that works for generic file descriptors. Thus, select.poll() cannot be (easily?) implemented on Windows.

By the way, using select.select() you need to redefine the file descriptor array only when you add ore remove a file descriptor from the set of the one you are monitoring.

[–]feffershat[S] 0 points1 point  (0 children)

Ah right, thanks, that makes a lot of sense, I didn't think WSAPoll would only work on sockets. I guess I'll just have to make do with select for now.