323 Star 1.6K Fork 345

GVPswoole / swoole-src

 / 详情

WebSocket的服务会自动关闭的问题

Done
Opened this issue  
2017-01-04 11:30

输入图片说明
每天我都需要关闭Swoole,然后再重新再服务器中启动一次文件才行。请问这个什么问题?我每天使用的时候都遇到这问题,重启后是正常的,但过了一天服务器调用实例时候就会报出以上图中的错误,一直无法连上WebSocket服务

版本:1.9

代码:
$socket_client = new WebSocketClient('127.0.0.1', 9501);
$socket_client -> connect();
$send_data = array(
'action' => 'picccase',
);
$socket = $socket_client->send(json_encode($send_data));

Comments (3)

LOK created 任务
LOK updated 任务
LOK updated 任务

你的Server没有开启守护进程吧

@swoole 原来我很早之前一直沿用旧版本的设置,以前使用true('daemonize' => true),现在的版本全部都改为1('daemonize' => 1),系统才能开启保护进程。改了之后就正常了,谢谢。

LOK closed 任务

现在要写1吗?我也遇到这个问题了,服务端自动失效了,我看官方例子写的true啊

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(3)
C
1
https://gitee.com/swoole/swoole.git
git@gitee.com:swoole/swoole.git
swoole
swoole
swoole-src

Search