首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
php 客户端运行异步模式 Operation now in progress [115]
在php客户端运行 $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_ASYNC);// $client->on("connect", function($cli) { $cli->send("hello world\n"); }); $client->on("receive", function($cli){ echo "Receive: ".$cli->recv().PHP_EOL; }); $client->on("error", function($cli){ echo "connect fail\n"; }); 都是示例代码就不贴全了 会报 Warning: swoole_client: connect to server[127.0.0.1:9501] fail. Error: Operation now in progress [115] in /usr/share/nginx/html/swoole_cli.php on line 6 Connect Server fail.errCode=Operation now in progress 但如果设置 $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC); 就可以运行 不知道怎么解决呢,是否就不能支持异步
发布于11年前 · 6 次浏览 · 来自
提问
r
rookie
在php客户端运行 $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_ASYNC);// $client->on("connect", function($cli) { $cli->send("hello world\n"); }); $client->on("receive", function($cli){ echo "Receive: ".$cli->recv().PHP_EOL; }); $client->on("error", function($cli){ echo "connect fail\n"; }); 都是示例代码就不贴全了 会报 Warning: swoole_client: connect to server[127.0.0.1:9501] fail. Error: Operation now in progress [115] in /usr/share/nginx/html/swoole_cli.php on line 6 Connect Server fail.errCode=Operation now in progress 但如果设置 $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC); 就可以运行 不知道怎么解决呢,是否就不能支持异步
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2015-07-11
h
haozy
请到pecl.php.net或者Github主页上下载releases版本的swoole。
赞
0
回复