mirror of
https://github.com/apple/swift-nio
synced 2026-11-22 04:30:41 +00:00
This PR gets TCP (Servers) on Windows mostly working. I'll annotate my
PR for clarity.
**The one bug:**
If you open a TCP client connection to a Windows TCP server, it doesn't
read/write yet until a second connection comes in. This happens because
`reregister0` is called after `WSAPoll` is called - but WSAPoll isn't
woken up to know this so it doesn't know the new socket requests
read/writes/...
Also the EventLoop cannot be woken up during `el.execute { .. }` because
`SleepEx` isn't running. WSAPoll doesn't respond to this signal it
seems.
This makes the TCP server functionality not yet usable, but I thought
with this draft we could figure out what I'm missing.
Alternative considered: We can make `WSAPoll` limited to wake up every 1
ms for example, that way we can still get to these events at _some_
point.
---------
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: Fabian Fett <fabianfett@apple.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Oliver Drobnik <oliver@cocoanetics.com>
Co-authored-by: Jake Petroules <jake.petroules@apple.com>
Co-authored-by: George Barnett <gbarnett@apple.com>
Co-authored-by: Gabriele Mondada <gab@ijk.ch>