ErrorException: Redis::get(): Send of 58 bytes failed with errno=10054 遠(yuǎn)程主機(jī)強(qiáng)迫關(guān)閉了一個(gè)現(xiàn)有的連接。 in D:\net\vendor\workerman\workerman\Protocols\Http\Session\RedisSessionHandler.php:84
這種很大因素是長時(shí)間鏈接但沒數(shù)據(jù)來往導(dǎo)致被關(guān)閉了該鏈接,定時(shí)30秒發(fā)送下就好了
我是用webman的,webman的redis好像已經(jīng)實(shí)現(xiàn)了心跳包,workman你可以看看redis連接的地方,增加timer來實(shí)現(xiàn)心跳,或者做重連方案
你的改 vendor/workerman/workerman/Protocols/Http/Session/RedisSessionHandler.php
public function __construct($config)
方法里最后面加上
\Workerman\Timer::add(isset($config['ping']) ? $config['ping'] : 55, function () {
$this->_redis->get('ping');
});