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

hprose-ruby客户端data长度超过124,swoole服务端无响应 #8

Open
wqyer opened this issue Apr 9, 2018 · 3 comments
Open

Comments

@wqyer
Copy link

wqyer commented Apr 9, 2018

客户端:使用hprose-ruby,ruby:2.5.0,rails:5.1.5
服务端:使用hprose/swoole/server, php: 7.1.16, laravel: 5.5

实际使用过程中,客户端调用服务时,参数总体长度超过124时服务端疑似卡在

$self->defaultHandle($data, $context)->then(function($data) use ($self, $server, $socket, $id) { $self->socketSend($server, $socket, $data, $id); });

@wqyer
Copy link
Author

wqyer commented Apr 9, 2018

为了解决这个问题,我在客户端调用时先对参数进行了to_json和Base64两步转化
然后在服务端插件代码中插入一行代码($bytes = utf8_decode($bytes);)以解决这个问题
use ($self, &$bytes, &$headerLength, &$dataLength, &$id) { $bytes .= $data; $bytes = utf8_decode($bytes); while (true) {

@wqyer
Copy link
Author

wqyer commented Apr 9, 2018

但这毕竟不是一个根本的解决办法,看看有没有更好的解决办法

@andot
Copy link
Member

andot commented Apr 11, 2018

不知道 hprose-ruby 版本是不是你修改过,我看到 hprose-ruby 版本有个 pull request 提交,但那个修改是错误的。如果你用的是那个修改版本的 hprose-ruby,肯定是不能互通的。请不要自己修改 hprose-ruby,使用原版的就可以了。

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