Move address polling to a Job, better catch Socket connection refused errors
This commit is contained in:
@@ -241,7 +241,13 @@ final class SocketClient {
|
||||
if ($socket === FALSE)
|
||||
throw new SocketException(SocketException::CANT_CREATE_SOCKET,socket_strerror(socket_last_error($socket)));
|
||||
|
||||
$result = socket_connect($socket,$address,$port);
|
||||
try {
|
||||
$result = socket_connect($socket,$address,$port);
|
||||
|
||||
} catch (\ErrorException $e) {
|
||||
throw new SocketException(SocketException::CANT_CONNECT,socket_strerror(socket_last_error($socket)));
|
||||
}
|
||||
|
||||
if ($result === FALSE)
|
||||
throw new SocketException(SocketException::CANT_CONNECT,socket_strerror(socket_last_error($socket)));
|
||||
|
||||
|
Reference in New Issue
Block a user