Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages for failed TCP/IP connections with errno/errstr #265

Merged
merged 1 commit into from
Aug 8, 2021

Conversation

clue
Copy link
Member

@clue clue commented Aug 8, 2021

This changeset improves the error messages for failed TCP/IP connections to include the appropriate errno/errstr. Whereas it would previously report a generic "Connection refused" error, it will now report the actual underlying error condition, such as this:

$ telnet 192.168.0.1 8080
Trying 192.168.0.1...
telnet: Unable to connect to remote host: Network is unreachable
$ php examples/11-http-client.php 192.168.0.1
RuntimeException: Connection to tcp://192.168.0.1:80 failed: Network is unreachable in …/TcpConnector.php:115

Builds on top of #171, reactphp/dns#171, reactphp/dns#172 and others

@clue clue added this to the v1.10.0 milestone Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants