PHP code example of momo / swoole_clients

1. Go to this page and download the library: Download momo/swoole_clients 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/ */

    

momo / swoole_clients example snippets


 //自定义回调只需要实现ISwooleCallback接口即可
 $client = new \Client\TcpClient($swoole,$data,new \Swoole\SwooleCallback());
 

 $data = [
     'name' => 'fxj',
     'age' => 18,
 ];
 $res = $client->doConnect('192.168.3.10',8090);
 var_dump($res);