mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
Windows flavor of non-blocking IO, overlapped IO, differs from that on Linux. On Windows, the OS handles writing to overlapped buffer, while on Linux user must do it manually. Additionally, we can only have overlapped sockets because it is the requirement to be able to wait on them - WSAEventSelect automatically sets socket to nonblocking mode. So we end up emulating Linux-nonblocking sockets with Windows-nonblocking sockets. Pending IO state (ERROR_IO_PENDING) must not escape read/write functions. If that happens, all synchronization like WSAPoll and WaitForMultipleObjects stops working (WaitForMultipleObjects stops working because with overlapped IO you are supposed to wait on an event in OVERLAPPED structure, while we are waiting on WSA Event, see EventLoopImplementationWindows.cpp).
4.0 KiB
4.0 KiB