PHP code example of uniondrug / tcp-client

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

    

uniondrug / tcp-client example snippets


return [
    'default' => [
        ......
        'providers'           => [
            ......
            \Uniondrug\TcpClient\TcpClientServiceProvider::class,
        ],
    ],
];

    // 在 Injectable 继承下来的对象中:
    $data = $this->getDI()->getShared('tcpClient')->get($url);

    // 或者 直接使用 属性方式
    $data = $this->tcpClient()->get($url)