ikskuh / zig-network

A smallest-common-subset of socket functions for crossplatform networking, TCP & UDP
MIT License
484 stars 59 forks source link

Fix Windows polling #89

Closed mochalins closed 4 months ago

mochalins commented 4 months ago

Noticed that #88 broke Windows SocketSet functionality, but it wasn't caught by any tests. Added coverage for SocketSet functions and polling. Also added one additional check to the "Connect to an echo server" test (expecting that the read message from the socket should match the write message), and changed allocator usage to std.testing.allocator instead of the previous page_allocator. Reverted pertinent polling-related parts of #88.

mochalins commented 4 months ago

@ikskuh My apologies, PR #88 introduced breakage for SocketSet and waitForSocketEvent on Windows. Related changes were reverted, and I've now set up wine-based testing locally and added tests to the suite for CI to avoid such issues in the future.

As an aside, it appears possible to completely remove select and all of WindowsOSLogic in favor of simply using std.posix.poll pending this Ziglang PR, but I wanted to check in with you and ask if you were aware of any particular reason to specifically favor select on Windows over WSAPoll?