Code

30c39b9d6c2105a9bedde1e1ded1a4f3b65ad433
[gosa.git] / gosa-si / tests / client.php
1 #!/usr/bin/php5 -q
2 <?php
4 require_once("../../gosa-core/include/class_socketClient.inc");
5 error_reporting(E_ALL);
7 $sock = new Socket_Client("10.89.1.155","20082",TRUE,1);
8 #$sock = new Socket_Client("169.254.2.248","9999",TRUE,1);
9 $sock->setEncryptionKey("secret-gosa-password");
11 if($sock->connected()){
12         /* Prepare a hunge bunch of data to be send */
13         #$data = "<xml><header>gosa_ping</header><source>10.89.1.155:20082</source><target></target><mac>11:22:33:44:55</mac></xml>";
14         #$data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>19700101000000</timestamp> </xml>";
15         #$data = "<xml> <header>job_sayHello</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
16         #$data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
17         $data = "<xml><header>gosa_query_jobdb</header><where>status</where><status>waiting</status></xml>";
18         $sock->write($data);
21   #$sock->setEncryptionKey("ferdinand_frost");
23         $answer = $sock->read();        
24   echo "$answer\n";
25         $sock->close(); 
26 }else{
27         echo "... FAILED!\n";
28 }
30 ?>