stream_socket_get_name

Supported Versions: PHP 5, PHP 7, PHP 8
Retrieve the name of the local or remote sockets
<?php stream_socket_get_name(resource $socket, bool $remote): string|false
<?php     Loop::cancelTimer($timer);




    if (stream_socket_get_name($stream, true) === false) {

        echo '[unable to connect]' . PHP_EOL;

        exit(1);

    } else {
<?php         $server = stream_socket_server('127.0.0.1:0');



        $errno = $errstr = null;

        $connecting = stream_socket_client(stream_socket_get_name($server, false), $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);



        $loop = $this->loop;

        $timeout = $loop->addTimer(0.1, function () use ($connecting, $loop) {