think-swoole websocket发送消息连接中断问题
muke
每日精进
muke
2022-05-23 14:45:57
1457
{{single.collect_count}}

在vendor/thinkphp/topthink/think-swoole/src/websocket/socketio/Handler.php的onMessage方法中修改代码:

 

public function onMessage(Frame $frame)
{
        // 修改底层(监听消息回调)
        $frameData = json_decode($frame->data);
        $this->event->trigger('swoole.websocket.'.ucfirst($frameData->type), $frameData->data);
        $this->resetPingTimeout($this->pingInterval + $this->pingTimeout);
}
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}