Add communication with the scheduler (through socket)

This commit is contained in:
nemunaire 2014-11-23 18:06:18 +01:00
commit 87af2e3506
4 changed files with 14 additions and 1 deletions

View file

@ -22,6 +22,16 @@ if (is_file($VAR["misc_dir"]."/challenge_started"))
$template->assign("END", $VAR['end_challenge']);
}
function pipe_backend_scheduler($instruct)
{
$socket = socket_create(AF_UNIX, SOCK_STREAM, 0);
if (is_writable($VAR["scheduler_socket"]) && socket_connect($socket, $VAR["scheduler_socket"]))
{
socket_write($socket, $instruct);
socket_close($socket);
}
}
if (!empty($VAR['misc_dir']))
$template->assign("MISC_DIR", $VAR['misc_dir']);
if (!empty($LANG))