Notice: the documentation is suitable for PHP extension
swooleuntil v4.7.1, we only support PHP extension
<?php Swoole\Client::__construct ( $type, $async = null, $id = null )
The type of the client
This field should always be empty.
The ID of the client.
Create a sync TCP/UDP client, with or without SSL.
Compile Swoole with
with-openssl-dirto support SSL. Also add
SWOOLE_SSLto the constructor.
Establish a SSL connection.
<?php $client = new Swoole\Client(SWOOLE_SOCK_TCP | SWOOLE_SSL);
Create persistent TCP connection:
<?php $client = new Swoole\Client(SWOOLE_TCP | SWOOLE_KEEP);