If there's anyone who's familiar with Aux scripts, and wants to post a small explanation of how they work.. it'd be very handy to the rest of us
Anyone?
Code: Select all
AuxService
{
Port (intger port)
Script (string script filename)
}Code: Select all
use uo;
use os;
program auxControl(connection)
var ev;
print("AuxControl->connection established");
while ( connection )
ev := wait_for_event(5);
print("AuxControl->recieved: "+ev.value);
if ( ev )
print ev.value;
endif
endwhile
print("AuxControl->connection terminated");
endprogramCode: Select all
<?
$polServer = "tribulation.sytes.net";
$polAuxPort = 5012;
$fp = fSockOpen($polServer, $polAuxPort);
if ( $fp ) {
// sHello = string "Hello", i10 = integer 10, like any other "packed" data
// very important to have \r\n or POL will not know when the string is terminated
fwrite($fp, "sHello\r\n");
stream_set_timeout($fp, 2);
$status = socket_get_status($fp);
$data = "";
while ( !feof($fp) && !$status['timed_out'] ) {
$data .= fgets($fp, 1000);
// Data is finished if last char is return
if ( ord(substr($data, strlen($data) - 1, 1) == chr(10)) )
break;
else
$status = socket_get_status($fp);
}
}
if ( $data )
echo "Recieved response: " . $data;
else
echo "No data returned from server. Prepare for crying.";
?>Code: Select all
connection.transmit(stuff);Code: Select all
CGI Timeout
The specified CGI application exceeded the allowed time for processing. The server has deleted the process.
Code: Select all
Warning: fsockopen(): unable to connect to ***.**.*.***:5003 in d:\inetpub\chyrellos\auxtest.php on line 8
Code: Select all
if (($connect = @fsockopen("127.0.0.1", 2020, $errno, $errstr, 2)) === FALSE) {
// the server is offline.
} else {
fputs($connect, $packet."\n");
$data = fgets($connect);
fclose($connect);
// the server is online. Information is stored in $data
}