PHP   47

server

Guest on 25th April 2022 01:33:18 AM

  1. <?php
  2.  
  3. require_once 'rpc_client.class.php';
  4. require_once 'rpc_server.class.php';
  5. require_once 'fubar.class.php';
  6. require_once 'rpc_nameservice.class.php';
  7.  
  8.  
  9. $fubar = new FUBAR();
  10.  
  11. class Server1Consts { const REQUEST_QUEUE_NAME = 'jobs'; const REPLY_QUEUE_NAME = 'repl1'; }
  12.  
  13. $server = new RPCServer(new Server1Consts());
  14. $server->addServant($fubar, 'andrey');
  15.  
  16. $nameService = RPCClient::getInstance('NameService', new NameServiceConsts());
  17. $nameService->registerServer($server->getNameServiceMetadata());
  18.  
  19. //print_r($nameService);
  20. $server->run();
  21.  
  22. ?>

Raw Paste


Login or Register to edit or fork this paste. It's free.