protected function stopTcpServer() { ProcessPid::killProcess($this->tcp_server_command_pid); $this->_configForm->updateParam('TCP_SERVER_COMMAND_PID', false); $this->_configForm->saveToFile(); }
public function actionStopListening() { if (!$_REQUEST['source']) { echo json_encode(array('errors' => array('Unknown connection type'))); Yii::app()->end(); } $source = strtoupper($_REQUEST['source']); $last_connection = Listener::getLastConnectionInfo($source); if ($last_connection && !$last_connection['stopped']) { ProcessPid::killProcess($last_connection['process_pid']); ListenerProcess::addComment($last_connection['listener_id'], 'comment', 'Stop by user'); Listener::stopConnection($last_connection['listener_id']); } echo json_encode(array('ok' => 1)); Yii::app()->end(); }