protected function event_socket_request($cmd)
 {
     $esl = new EventSocket($this->event_socket);
     $result = $esl->request($cmd);
     $esl->reset_fp();
     return $result;
 }
Beispiel #2
0
function event_socket_request($fp, $cmd)
{
    $esl = new EventSocket($fp);
    $result = $esl->request($cmd);
    $esl->reset_fp();
    return $result;
}
Beispiel #3
0
 protected function restart_switch()
 {
     $esl = new EventSocket();
     if (!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
         throw new Exception("Failed to connect to switch");
     }
     if (!$esl->request('api fsctl shutdown restart elegant')) {
         throw new Exception("Failed to send switch restart");
     }
     $esl->reset_fp();
 }