Example #1
0
  | This source file is subject to version 2.0 of the Apache license,    |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.apache.org/licenses/LICENSE-2.0.html                      |
  | If you did not receive a copy of the Apache2.0 license and are unable|
  | to obtain it through the world-wide-web, please send a note to       |
  | yiming_6weijun@163.com so we can mail you a copy immediately.        |
  +----------------------------------------------------------------------+
  | Author: Weijun Lu  <*****@*****.**>                          |
  +----------------------------------------------------------------------+
*/
namespace Application\Server;

define('AHA_SRC_PATH', dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'src');
require_once AHA_SRC_PATH . '/Aha/Bootstrap.php';
\Aha\Bootstrap::initLoader();
use Aha\Server\Tcp;
class TcpServer extends Tcp
{
    //Aha实例
    private $_objAha = null;
    public function __construct()
    {
        $server = new \swoole_server('0.0.0.0', 9602, SWOOLE_PROCESS, SWOOLE_SOCK_TCP);
        $this->setVarDirectory(dirname(__DIR__) . '/Var/');
        $arrSetting = array('log_file' => dirname(__DIR__) . '/Logs/Aha.log');
        parent::__construct($server, 'TcpServer', $arrSetting);
        $server->start();
    }
    /**
     * @brief 初始化MVC