Files
tracy/public
Fabian Knorr aa8a4c1264 Socket: Use poll()/select() + getsockopt() to reliably detect ECONNREFUSED
On macOS, calling connect() twice on a non-blocking socket does not allow distinguishing between successful and unsuccessful completion.

poll() / WSAPoll() would be the correct cross-platform API to check for socket readiness, however on Windows before 10 2004 WSAPoll() never completes on a failed connect().
https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect documents that select() should be used instead. select() is an inferior choice on Unices,
where descriptors (ints) in fd_set are limited to < FD_SETSIZE (1024).
2026-11-13 09:53:05 +01:00
..