Commit 48f04194 authored by 冯超鹏's avatar 冯超鹏

tcp ssl

parent 18d7a190
Pipeline #150 canceled with stages
......@@ -57,7 +57,7 @@ class alarm extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9601); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9601,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
......
......@@ -57,7 +57,7 @@ class chemicalswb extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9507); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9507,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
......
......@@ -57,7 +57,7 @@ class firewb extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9508); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9508,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
......
......@@ -57,7 +57,7 @@ class swoole extends Command
{
$url = config('public.swoolwebsocketurl');
$por = config('public.swoolwebsocketurlpor');
$this->ws = new \swoole_websocket_server('0.0.0.0', 9502); //创建一个端口
$this->ws = new \swoole_websocket_server('0.0.0.0', 9502,SWOOLE_SOCK_TCP | SWOOLE_SSL); //创建一个端口
$this->ws->set(array(
'reactor_num' => 2, //reactor线程数
'worker_num' => 4, //worker进程数
......
......@@ -55,10 +55,10 @@ class swooleMeTcp extends Command
public function start()
{
$url = config('public.swooletcpurl');
$this->tcp = new \swoole_server('0.0.0.0', 9503);
$this->tcp->addlistener($url, 9504, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->addlistener($url, 9505, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$this->tcp->addlistener($url, 9506, SWOOLE_SOCK_TCP); // 添加 TCP端口监听
$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_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this->tcp->set([
'worker_num' => 2,//设置启动的 Worker 进程数
'max_request' =>30,//最大任务数
......
......@@ -72,7 +72,7 @@ class swooleMqtt extends Command
}
public function start()
{
$this->mqtt = new \swoole_server("0.0.0.0", 9506, SWOOLE_BASE);
$this->mqtt = new \swoole_server("0.0.0.0", 9506, SWOOLE_BASE,SWOOLE_SOCK_TCP | SWOOLE_SSL);
$this->mqtt->set([
'open_mqtt_protocol' => true, // 启用 mqtt 协议
'worker_num' => 1,
......
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