We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protected $socket = 'websocket://0.0.0.0:2346'; protected $processes = 1; public $uidConnections = array(); public function onWorkerStart($worker) { echo 'work start!'; //开启一个内部端口,方便内部系统推送数据,Text协议格式 文本+换行符 $inner_text_worker = new Worker('text://0.0.0.0:5678'); $inner_text_worker->onMessage = function($connection, $buffer) { global $worker; // $data数组格式,里面有uid,表示向那个uid的页面推送数据 $data = json_decode($buffer, true); $uid = $data['uid']; // 通过workerman,向uid的页面推送数据 $ret = $this->sendMessageByUid($uid, $buffer); // 返回推送结果 $connection->send($ret ? 'ok' : 'fail'); }; // ## 执行监听 ## $inner_text_worker->listen(); } `
` onWorkerStart 内部启动worker会报错,貌似陷入死循环
work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED work start!Workerman[server.php] start in DEBUG mode Workerman[server.php] already running WORKER EXIT UNEXPECTED
The text was updated successfully, but these errors were encountered:
有例子不用,瞎几把搞。
Sorry, something went wrong.
老哥,稳
向指定客户端返回数据的例子在哪儿?你来给咱说说???
No branches or pull requests
`
onWorkerStart 内部启动worker会报错,貌似陷入死循环
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
work start!Workerman[server.php] start in DEBUG mode
Workerman[server.php] already running
WORKER EXIT UNEXPECTED
The text was updated successfully, but these errors were encountered: