PHP   40

nameserver

Guest on 25th April 2022 01:32:17 AM

  1. <?php
  2.  
  3. require_once 'rpc_server.class.php';
  4. require_once 'fubar.class.php';
  5. require_once 'rpc_nameservice.class.php';
  6. require_once 'cmdopts.class.php';
  7.  
  8. $class= new ReflectionClass('NameServiceConsts');
  9. $classConsts = $class->getConstants();
  10. CmdOpts::setDefaultParamValues($classConsts);
  11. $configuration = new stdClass();
  12. foreach (array_keys($classConsts) as $k) {
  13.         $configuration->$k = CmdOpts::getOptionValue($k);
  14. }
  15. var_dump((array)$configuration);
  16.  
  17. $nameService = new RPCNameService();
  18. $nameServiceServer = new RPCServer($configuration);
  19. $nameServiceServer->addServant($nameService, "NameService");
  20.  
  21. //print_r($nameServiceServer);
  22. $nameServiceServer->run();
  23.  
  24. ?>

Raw Paste


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