Commit 0ebd3b5a authored by Administrator's avatar Administrator

tcp连接禁用ssl

parent 009f2adb
...@@ -55,10 +55,14 @@ class swooleMeTcp extends Command ...@@ -55,10 +55,14 @@ class swooleMeTcp extends Command
public function start() public function start()
{ {
$url = config('public.swooletcpurl'); $url = config('public.swooletcpurl');
$this->tcp = new \swoole_server('0.0.0.0', 9503, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // $this->tcp = new \swoole_server('0.0.0.0', 9503, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL);
$this->tcp->addlistener('0.0.0.0', 9504, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听 //// $this->tcp->addlistener('0.0.0.0', 9504, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听 //// $this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听 //// $this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp = new \swoole_server('0.0.0.0', 9503, SWOOLE_PROCESS,SWOOLE_SOCK_TCP);
$this->tcp->addlistener('0.0.0.0', 9504, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->set([ $this->tcp->set([
'worker_num' => 2,//设置启动的 Worker 进程数 'worker_num' => 2,//设置启动的 Worker 进程数
'max_request' =>30,//最大任务数 'max_request' =>30,//最大任务数
...@@ -67,8 +71,8 @@ class swooleMeTcp extends Command ...@@ -67,8 +71,8 @@ class swooleMeTcp extends Command
'backlog' => 128, 'backlog' => 128,
'heartbeat_check_interval' => 30, 'heartbeat_check_interval' => 30,
'heartbeat_idle_time' => 65, 'heartbeat_idle_time' => 65,
'ssl_cert_file' => base_path() . config('app.ssl_cert_file'), // 'ssl_cert_file' => base_path() . config('app.ssl_cert_file'),
'ssl_key_file' => base_path() . config('app.ssl_key_file'), // 'ssl_key_file' => base_path() . config('app.ssl_key_file'),
]); ]);
//监听连接进入事件 //监听连接进入事件
$this->tcp->on('Connect', function ($serv, $fd) { $this->tcp->on('Connect', function ($serv, $fd) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment