Swoole\Client->getSocket

Latest version: pecl install openswoole-4.11.1

Declaration

<?php Swoole\Client->getSocket()

Parameters

Return

Description

Get the Socket. Then you can use socket API on the socket.

Example

<?php
$socket = $client->getSocket();
if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) {
    echo 'Unable to set option on socket: '. socket_strerror(socket_last_error()) . PHP_EOL;
}
Last updated on March 31, 2022