BayEOS-PHP
 All Data Structures Namespaces Files Functions Variables Pages
MySimpleClient.php
Go to the documentation of this file.
1 #!/usr/bin/php
2 <?php
3 /*
4  * This is an example for BayEOSSimpleClient
5  *
6  * BayEOSSimpleClient uses fork to start a Sender process
7  *
8  */
9 
10 
11 require_once 'BayEOSGatewayClient.php';
12 
13 //Configuration
14 $path='/tmp/bayeos-simpleClient2';
15 $name="mySimpleClient";
16 $url="http://bayconf.bayceer.uni-bayreuth.de/gateway/frame/saveFlat";
17 
18 //Create a BayEOSSimpleClient
19 //Note: This already forks the sender process
21 
22 //Setup signal handling for SIGTERM
23 declare(ticks = 1);
24 pcntl_signal(SIGTERM, function($signo) {
25  $GLOBALS['c']->stop();
26 });
27 
28 //Do your data stuff here...
30 while(TRUE){
31  echo "adding frame\n";
32  $c->save(array($count++,300,1.0));
33  sleep(5);
34 }
35 
36 ?>
$count