OpenSwoole\Client->getSocket

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\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 September 1, 2022