PHP code example of vincentmi / php-rpc-client
1. Go to this page and download the library: Download vincentmi/php-rpc-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/ */
vincentmi / php-rpc-client example snippets
use Tourscool\RpcClient\Client;
$client = new Client([
'endpoints'=>[
'tcp://192.168.1.251:20182' ,
'tcp://192.168.1.252:2010'
]
]);
try {
$result = $client->service('Greeting')->sayHello('Vincent');
print_r($result);
}catch(RpcException $e){
echo 'RPC fail';
}