reactphp / socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
https://reactphp.org/socket/
MIT License
1.2k stars 156 forks source link

Improve errno detection for failed connections without ext-sockets #304

Closed clue closed 1 year ago

clue commented 1 year ago

This changeset improves errno detection for failed connections without ext-sockets. Reporting the errstr already works on most platforms even when ext-sockets is not installed, consistently reporting the correct errno previously required ext-sockets. With these changes applied, we now also take the errno constants from ext-pcntl and ext-posix into account. This is particularly useful for lightweight container images (Docker) that by default come with ext-sockets and ext-pcntl disabled but ext-posix enabled. All extensions remain entirely optional.

Link dump:

Builds on top of #271, #267, #266 and others