function killProcess() { $process = new Process(); $process->kill(); }
// Try to send the message 3 times for($i = 0; $i < 3; $i++) { if($debug) { echo "Sending message\n"; } if(!$process) { $process = new Process(1153 + $i); if(!$process->init()) { echo "Error while starting child process\n"; $process->kill(); $process = false; if($debug) { echo "Sleeping 10 seconds before trying again\n"; } sleep(10); continue; } } $result = $process->sendMessage($deviceToken, $value); if($result) { if($debug)
/** * Kill * * @param $signal */ public function kill($signal = SIGINT) { $this->child->kill($signal); }