BayEOS-PHP
 All Data Structures Namespaces Files Functions Variables Pages
MyThreadClient.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Run the Sender in the background as thread
4  *
5  * To run this script you have to install pthreads manually
6  *
7  *
8  */
9 require_once 'BayEOSGatewayClient.php';
10 $path='/tmp/bayeos-thread1';
11 $name="myClientThread";
12 $url="http://bayconf.bayceer.uni-bayreuth.de/gateway/frame/saveFlat";
13 
14 //Create a BayEOSWriter
16 $w->saveMessage("MyClientThread.php started");
17 
18 //Create a BayEOSSender and start it as thread
19 class SenderThread extends Thread {
20  public function run() {
21  $s = new BayEOSSender($GLOBALS['path'],$GLOBALS['name'],$GLOBALS['url']);
22  $s->run();
23  }
24 }
26 $s_thread->start();
27 
28 
29 //Add your data stuff here...
31 while(TRUE){
32  echo "adding frame\n";
33  $w->save(array($count++,300,1.0));
34  sleep(5);
35 }
36 
37 ?>
$count
$s
Definition: BayEOSSender.php:7
$s_thread