/dev/null 2>&1 " .
" 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 & " ;
exec($cmd);
sleep(2);
// Ok, now try again.
$clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
}
if ($clientsocket) {
/*
echo "Connected. Performing echo tests.
\n";
flush();
$cmd = "ECHO test echo string upon connection\n";
fwrite($clientsocket, $cmd);
$response = fgets($clientsocket, 4096);
echo "Response is: ", $response, "
\n";
flush();
$cmd = "ECHO second test for echo\n";
fwrite($clientsocket, $cmd);
$response = fgets($clientsocket, 4096);
echo "Response is: ", $response, "
\n";
flush();
*/
}
else {
echo "ERROR: no Citadel socket!
\n";
flush();
}
}
//
// Clear out both our Citadel session and our PHP session. We're done.
//
function ctdl_end_session() {
global $clientsocket, $session;
// Tell the Citadel server to terminate our connection.
// (The extra newlines force it to see that the Citadel session
// ended, and the proxy will quit.)
//
fwrite($clientsocket, "QUIT\n\n\n\n\n\n\n\n\n\n\n");
$response = fgets($clientsocket, 4096); // IGnore response
fclose($clientsocket);
unset($clientsocket);
// Now clear our PHP session.
$_SESSION = array();
session_write_close();
}
?>