stream_socket_client throws fatal error if network is unreachable
https://github.com/reactphp/socket/blob/def0730288b2a321db04f22caf86259ab2975cc7/src/TcpConnector.php#L91
This should be handled more gracefully by returning with a rejected promise if it fails to connect.
@valzargaming Thanks for reporting, I'm still trying to understand what's going on here. The stream_socket_client() function never throws on its own, it only reports an E_WARNING on error or reports a SO_ERROR later on the socket. Both of these error classes are handled by the code following the stream_socket_client() function and the entire code has 100% code coverage including any errors cases.
-
Can you help us reproduce the problem you're seeing?
-
Specifically, please provide a gist that allows us the see the error you're seeing.
-
Could this perhaps be related to a custom error handling (
set_error_handler()function like #290)? If so, what does it look like and what makes you think this is an error in ReactPHP rather than the custom error handler?
Thank you.
I'll take a closer look at this later this week, but I believe 3 is the likely culprit.