Newer
Older
Php-rpc / listen-rpc.php
@johnpearcey Dlat johnpearcey Dlat on 1 Dec 409 bytes wip
  1. <?php
  2.  
  3. include "sysVcom.php";
  4.  
  5. //clear the queues at startup - otherwise things can get tricky
  6. clear_IPC( );
  7.  
  8. $msgArr = null;
  9.  
  10. while(true){
  11. $caller_id = 0;
  12. $obj = rpc_listen( $caller_id, $msgArr );
  13.  
  14. //print_r( $obj );
  15. //do something with the data
  16. array_unshift( $obj, "Greetings" );
  17.  
  18. //send msg back
  19. rpc_reply( $caller_id, $obj );
  20.  
  21. //done with the message
  22. unset( $msgArr[$caller_id] );
  23. }
  24.  
  25. ?>