+- **`feof()` on sockets unreliable on Windows**: `WSAPoll(timeout=0)` fails to detect FIN packets on Windows, causing `feof()` to return false on closed sockets. Fixed by skipping poll for liveness checks (`value==0`) and going directly to `recv(MSG_PEEK)`. On Windows, `MSG_DONTWAIT` is unavailable, so non-blocking mode is temporarily toggled via `ioctlsocket`. Errno is saved immediately after `recv` because `ioctlsocket` clears `WSAGetLastError()`. Shared logic extracted into `php_socket_check_liveness()` in `network_async.c` to eliminate duplication between `xp_socket.c` and `xp_ssl.c`.
0 commit comments