PHP code example of raylin666 / client

1. Go to this page and download the library: Download raylin666/client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

raylin666 / client example snippets




nction () {
    $client = new Raylin666\Client\Client;
    $swooleClient = $client()->getFactory()->getClient();

    $options = new Raylin666\Client\Swoole\SwooleClientOptions;
    $swooleClient->set($options);

    $swooleClient->connect('127.0.0.1', 9903);
    $swooleClient->send(['a' => 'c']);
    $result = $swooleClient->recv();
    var_dump($result);
    $swooleClient->close();
});

\Swoole\Event::wait();