1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 14:01:14 +01:00

Use 127.0.0.1 instead of localhost

Avoids DNS lookup issues on Windows.
This commit is contained in:
Aaron Piotrowski 2018-10-21 10:09:28 -05:00
parent 8d60fdbb64
commit cb2aa9c59c
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -35,7 +35,7 @@ class ProcessHub
$isWindows = \strncasecmp(\PHP_OS, "WIN", 3) === 0;
if ($isWindows) {
$this->uri = "tcp://localhost:0";
$this->uri = "tcp://127.0.0.1:0";
} else {
$this->uri = "unix://" . \tempnam(\sys_get_temp_dir(), "amp-parallel-ipc-") . ".sock";
}
@ -49,7 +49,7 @@ class ProcessHub
if ($isWindows) {
$name = \stream_socket_get_name($this->server, false);
$port = \substr($name, \strrpos($name, ":") + 1);
$this->uri = "tcp://localhost:" . $port;
$this->uri = "tcp://127.0.0.1:" . $port;
}
$keys = &$this->keys;