1
0
mirror of https://github.com/danog/ipc.git synced 2024-11-26 20:15:05 +01:00

Weird fix

This commit is contained in:
Daniil Gentili 2021-09-24 18:32:52 +02:00
parent d769b163ca
commit 6bbd35f057
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -95,10 +95,11 @@ class IpcServer
$errors[$type] = "could not connect to the FIFO socket: $error"; $errors[$type] = "could not connect to the FIFO socket: $error";
} else { } else {
$listenUri = $type === self::TYPE_TCP ? "tcp://127.0.0.1:0" : "unix://".$uri; $listenUri = $type === self::TYPE_TCP ? "tcp://127.0.0.1:0" : "unix://".$uri;
$errno = -1;
$errstr = 'no error';
try { try {
$this->server = \stream_socket_server($listenUri, $errno, $errstr, \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN); $this->server = \stream_socket_server($listenUri, $errno, $errstr, \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN);
} catch (\Throwable $e) { } catch (\Throwable $e) {
$errno = -1;
$errstr = "exception: $e"; $errstr = "exception: $e";
} }
if ($this->server) { if ($this->server) {