“慢生活”不是懒惰,放慢速度不是拖延时间,而是让我们在生活中寻找到平衡。网站首页程序人生
workerman端口复用reusePort属性实现同一个入口监听多个协议及端口
发布时间:2021-11-29 23:00:21作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
这个就很有意思了像是下面这样,同一个入口文件,既能处理text协议,也能处理http协议:start.php:<?phpuse Workerman\Worker;use Workerman\Connection\TcpConnection;require_on
阅读全文>>workerman端口复用reusePort属性
发布时间:2021-11-29 22:52:55作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
要求(workerman >= 3.2.1 并且 PHP>=7.0)这两个要求,我都满足,我这里是workerman4系列,php7.3.4设置当前worker是否开启监听端口复用(socket的SO_REUSEPORT选项)。开启监听端口复
阅读全文>>workerman只在指定进程运行的定时器
发布时间:2021-11-29 21:42:37作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
test.php:<?phpuse Workerman\Worker;use Workerman\Lib\Timer;require_once __DIR__ . '/vendor/autoload.php'; $worker = new Worker('tcp://0.0.0.0:8585');$worker->c
阅读全文>>workerman属性-protocol(基于tcp实现http)
发布时间:2021-11-29 21:42:03作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
test.php:<?phpuse Workerman\Worker;use Workerman\Connection\TcpConnection;require_once __DIR__ . '/vendor/autoload.php'; $worker = new Worker('tcp://0.0.0.0:86
阅读全文>>workerman识别进程-name属性
发布时间:2021-11-29 21:41:05作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
一个没有配置name属性的workerman脚本:test.php<?phpuse Workerman\Worker;use Workerman\Lib\Timer;require_once __DIR__ . '/vendor/autoload.php'; $worker = new Worke
阅读全文>>