Skip to content
New issue

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

master版本某些机器上的swoole_process内的swoole_event_write,产生Assertion failed: (fd > 2), function swReactor_write警告 #247

Closed
tangxunye opened this issue Apr 24, 2015 · 1 comment

Comments

@tangxunye
Copy link

测试多线程的event事件时发现

$mcqs) { $process = new swoole_process('callback_function', false, false); $pid = $process->start(); } function callback_function(swoole_process $worker) { $pid = $worker->pid; echo "Worker: start. PID=".$pid."\n"; ``` $fp = stream_socket_client("tcp://127.0.0.1:9511", $code, $msg, 3); if (!$fp) { exit("$errstr ($errno)\n"); } $data = "1000"; fwrite($fp, $data); swoole_event_add($fp, function($fp){ //echo fread($fp, 8192); //swoole_event_del($fp); //fclose($fp); }); echo "Re:".$fp.PHP_EOL; swoole_event_write($fp, $data); swoole_event_exit(); $worker->exit(0); ``` } swoole_process::wait(); swoole版本master,使用2015年的mac时,结果如下 Worker: start. PID=9724 Worker: start. PID=9725 Worker: start. PID=9726 Re:Resource id #5 Assertion failed: (fd > 2), function swReactor_write, file /Code/swoole_src/src/reactor/ReactorBase.c, line 240. Re:Resource id #5 Assertion failed: (fd > 2), function swReactor_write, file /Code/swoole_src/src/reactor/ReactorBase.c, line 240. Re:Resource id #5 Assertion failed: (fd > 2), function swReactor_write, file /Code/swoole_src/src/reactor/ReactorBase.c, line 240. swoole版本master,使用2010年的mac时, 和swoole版本为1.7.15stable,使用2015年mac时,结果如下 Worker: start. PID=14416 Worker: start. PID=14417 Worker: start. PID=14418 Re:Resource id #6 Re:Resource id #7 Re:Resource id #8
@matyhtf
Copy link
Member

matyhtf commented Feb 1, 2016

新版本已解决。

@matyhtf matyhtf closed this as completed Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants