首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
求助 swReactorThread_send (ERROR 1005)
线上服务,其中几台一直报这个错误 [2016-06-27 15:50:12 #2185.6] ERROR swReactorThread_send (ERROR 1005): send event$[4] failed, session#182 does not exist. 同样的程序,不是所有的服务器都报,不知道什么原因。 ``` public function __construct() { $this->serv = new swoole_server("0.0.0.0",9501); $this->serv->set(array( 'worker_num' => 8, 'daemonize' => 1, 'max_request' => 1000, 'dispatch_mode' => 3, 'debug_mode' => 1, 'task_worker_num' => 8, 'heartbeat_idle_time' => 200, 'heartbeat_check_interval' => 180, 'log_file' => '/var/log/swoole.log' )); $this->serv->on('Start', array($this, 'onStart')); $this->serv->on('WorkerStart', array($this, 'onWorkerStart')); $this->serv->on('Connect', array($this, 'onConnect')); $this->serv->on('Receive', array($this, 'onReceive')); $this->serv->on('Close', array($this, 'onClose')); $this->serv->on('Task', array($this, 'onTask')); $this->serv->on('Finish', array($this, 'onFinish')); $this->serv->start(); } public function onWorkerStart( $serv , $worker_id) { echo "onWorkerStart:{$worker_id}\n"; $serv->rds = Misc_Cache::Factory(); $serv->dbHome = Db_Home::Factory('r'); } public function onStart($serv) { echo "Start \n"; } public function onConnect($serv, $fd, $from_id) { $serv->send( $fd, "Hello {$fd}!" ); } public function onClose($serv, $fd, $from_id) { echo "Client {$fd} close connection \n"; } public function onReceive(swoole_server $serv, $fd, $from_id, $data) { $serv->task( $data ); $serv->close( $fd ); } public function onTask(swoole_server $serv, $task_id, $from_id, $data) { //dosomething here } public function onFinish($serv,$task_id, $data) { //echo "Task {$task_id} finishn, data:".var_export($data,true); //echo "Result: {$data}n"; } } ```
发布于8年前 · 1 次浏览 · 来自
提问
n
nethuige
线上服务,其中几台一直报这个错误 [2016-06-27 15:50:12 #2185.6] ERROR swReactorThread_send (ERROR 1005): send event$[4] failed, session#182 does not exist. 同样的程序,不是所有的服务器都报,不知道什么原因。 ``` public function __construct() { $this->serv = new swoole_server("0.0.0.0",9501); $this->serv->set(array( 'worker_num' => 8, 'daemonize' => 1, 'max_request' => 1000, 'dispatch_mode' => 3, 'debug_mode' => 1, 'task_worker_num' => 8, 'heartbeat_idle_time' => 200, 'heartbeat_check_interval' => 180, 'log_file' => '/var/log/swoole.log' )); $this->serv->on('Start', array($this, 'onStart')); $this->serv->on('WorkerStart', array($this, 'onWorkerStart')); $this->serv->on('Connect', array($this, 'onConnect')); $this->serv->on('Receive', array($this, 'onReceive')); $this->serv->on('Close', array($this, 'onClose')); $this->serv->on('Task', array($this, 'onTask')); $this->serv->on('Finish', array($this, 'onFinish')); $this->serv->start(); } public function onWorkerStart( $serv , $worker_id) { echo "onWorkerStart:{$worker_id}\n"; $serv->rds = Misc_Cache::Factory(); $serv->dbHome = Db_Home::Factory('r'); } public function onStart($serv) { echo "Start \n"; } public function onConnect($serv, $fd, $from_id) { $serv->send( $fd, "Hello {$fd}!" ); } public function onClose($serv, $fd, $from_id) { echo "Client {$fd} close connection \n"; } public function onReceive(swoole_server $serv, $fd, $from_id, $data) { $serv->task( $data ); $serv->close( $fd ); } public function onTask(swoole_server $serv, $task_id, $from_id, $data) { //dosomething here } public function onFinish($serv,$task_id, $data) { //echo "Task {$task_id} finishn, data:".var_export($data,true); //echo "Result: {$data}n"; } } ```
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2017-10-25
E
Exp_sbyps
连接不存在了。
赞
0
回复
2017-11-25
林
林晓易
我也报了很多这样的错,场景是在浏览器端的页面中,有段js来执行请求,只要我按着F5一直不送10秒,就一定会报这个错误了,如果是连接不存在了, 请问[@rango ](/u/1)什么样的情况下,这种http的请求的连接会不存在呢? 我的send是在task进程中发的, 是因为我自己把它释放了还是有其它原因呢,求指教~万分感谢~
赞
0
回复