Swoole\Client->getSocket

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;
}