Fix socket communication

This commit is contained in:
Némunaire 2015-01-13 07:46:27 +01:00 committed by Nemunaire
parent f1870a8555
commit d4e0f49668

View File

@ -29,7 +29,9 @@ function pipe_backend_scheduler($instruct)
$socket = socket_create(AF_UNIX, SOCK_STREAM, 0); $socket = socket_create(AF_UNIX, SOCK_STREAM, 0);
if (is_writable($VAR["scheduler_socket"]) && socket_connect($socket, $VAR["scheduler_socket"])) if (is_writable($VAR["scheduler_socket"]) && socket_connect($socket, $VAR["scheduler_socket"]))
{ {
socket_write($socket, $instruct); socket_write($socket, $instruct."\r\n") or die(socket_strerror(socket_last_error()));
sleep(1);
socket_shutdown($socket);
socket_close($socket); socket_close($socket);
} }
else if(defined("DEBUG") && DEBUG) else if(defined("DEBUG") && DEBUG)