summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/web/socket2.php
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/web/socket2.php')
-rw-r--r--notFinishedCode/web/socket2.php73
1 files changed, 0 insertions, 73 deletions
diff --git a/notFinishedCode/web/socket2.php b/notFinishedCode/web/socket2.php
deleted file mode 100644
index 475063a..0000000
--- a/notFinishedCode/web/socket2.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?
- $ip = "localhost";
- $port = 34500;
- exec("/usr/bin/python /var/www/server1.py > /dev/null 2>&1 &");
-// echo $result . '<br>';
-// echo str_repeat("\n",7024);
-// flush();
-
- sleep(2);
-
- $fp = fsockopen($ip, $port, $errno, $error, 5);
-
- if (!$fp)
- {
- printf('ERROR');
- }
- else
- {
- socket_set_timeout( $fp, 50); //one should set the number of the longest test, so we can define the timeout
- fwrite($fp, "START TEST"); //send command to start the tests
-
- if(!feof($fp))
- {
- while(!feof($fp))
- {
- $received = fgets($fp, 128);
- if ($received == "CONFIRM\n")
- {
- //echo 'CONFIRM CONNECTION <br>';
- echo '<table summary = "Submitted table designs">
- <caption> Table concept for our results </caption>
- <thead>
- <tr>
- <th scope = "col"> From: </th>
- <th scope = "col" > To: </th>
- <th scope = "col"> Message: </th>
- <th scope = "col"> Status: </th>
- </tr>
- </thead>
- <!-- start of the table rows-->
- <tbody>';
- echo str_repeat("\n",7024);
- flush();
- }
- elseif ($received == "TEST DONE\n")
- {
- echo '</tbody></table>';
- //echo 'DISCONNECT <br>';
- echo str_repeat("\n",7024);
- flush();
- usleep(100);
- fwrite($fp, 'DISCONNECT');
- break;
- }
- else
- {
- echo '<tr>
-<th scope = "row" id = "r100"> SIP</th>
-<th scope = "row" id = "r100">GSM1 </th>
-<td> '. $received . ' </td>
-<td> 200</td>
-</tr>';
- //echo $received . '<br>';
- echo str_repeat("\n",7024);
- flush();
- usleep(100);
- fwrite($fp, "CONTINUE");
- }
- }
- }
- fclose($fp);
- }
-?>