PHP code example of voryx / pool-poretni-cnysa-tcaer

1. Go to this page and download the library: Download voryx/pool-poretni-cnysa-tcaer 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/ */

    

voryx / pool-poretni-cnysa-tcaer example snippets


    //Create your async-interop loop
    
    $loop = new \Voryx\React\AsyncInterop\Loop();
    
    //Then use your ReactPHP loop like you normally would
    
    $client = stream_socket_client('tcp://127.0.0.1:1337');
    $conn = new React\Stream\Stream($client, $loop);
    $conn->pipe(new React\Stream\Stream(STDOUT, $loop));
    $conn->write("Hello World!\n");
    
    $loop->run();