Newer
Older
backup-commander / html / svc / main.php
@John P on MM John P on MM on 2 Dec 553 bytes wip
  1. <?php
  2.  
  3. include __DIR__."/../lib/sysVcom.php";
  4.  
  5. //create the comms file
  6. touch('BU-commander');
  7.  
  8. //remove all queues at startup
  9. clear_IPC( '../svc/BU-commander' );
  10.  
  11. rpc_setGlobals( 'procName', '../svc/BU-commander' );
  12. rpc_setGlobals( 'max_chan', 8182 );
  13.  
  14.  
  15. $msgArr = null;
  16.  
  17. while(true){
  18. $caller_id = 0;
  19. $obj = rpc_listen( $caller_id, $msgArr );
  20.  
  21. //print_r( $obj );
  22. //do something with the data
  23. array_unshift( $obj, "Greetings" );
  24.  
  25. //send msg back
  26. rpc_reply( $caller_id, $obj );
  27.  
  28. //done with the message
  29. unset( $msgArr[$caller_id] );
  30. }
  31.  
  32. ?>