PHP code example of werkint / reactphp-socket-client
1. Go to this page and download the library: Download werkint/reactphp-socket-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/ */
werkint / reactphp-socket-client example snippets
$loop = React\EventLoop\Factory::create();
$connector->create('google.com', 443)->then(
function (Stream $stream) {
// connection successfully established
},
function (Exception $error) {
// failed to connect due to $error
}
);