From: <rem...@gm...> - 2009-09-24 21:08:47
|
Wilbert Knol wrote: > Perhaps PHP is properly multi-threaded and you won't have the > same issues with the network socket. Thanks for the information. At the moment, I chose not to use the PHP bindings because it does not work (Miss cstring.i ) nor the perl bindings because the Apache server setup is not straightforward. As suggested by Nate, I use PHP which connects to rigctld, this is a pre-prototype with code such as this - the good thing is that it is possible to edit it with any HTML editor: <?php $dest = "127.0.0.1"; $port = 4532; ?> <?php $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $r = socket_connect($socket, $dest, $port); socket_getsockname($socket, $addr, $port); $newFreq = $_GET["frequency"]; if( $newFreq ) { socket_write($socket,"F " . $newFreq . "\n"); $msg = socket_read($socket,1000); } socket_write($socket,"f"); $freq = socket_read($socket,1000); ?> <HTML> <HEAD><TITLE>Hamlib WebRig <?php echo $dest ?> <?php echo $port ?></TITLE></HEAD> <BODY> <form action="hamlib.php" method="get"> <TABLE > <TR> <TD >Frequency </TD> <TD ><?php echo $freq ; ?></td> <td> ... |