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
open_length_check是目前最常用的解决业务粘包的方式,
现在实际开发过程中大都会做如下事情: send: $client->send(pack($config['package_length_type'], strlen($sendData)).$sendData);
recv: $recvData = $client->recv(); //省略了一些异常判断 return substr($recvData, $this->config['package_body_offset']);
收发包操作频繁,一方面增加理解难度,另一方面也会带来一些性能损耗
底层在内置pack和unpack方法 $client->send(package_pack($sendData)); $recvData = package_unpack($client->recv);
无
The text was updated successfully, but these errors were encountered:
No branches or pull requests
现状
open_length_check是目前最常用的解决业务粘包的方式,
现在实际开发过程中大都会做如下事情:
send:
$client->send(pack($config['package_length_type'], strlen($sendData)).$sendData);
recv:
$recvData = $client->recv();
//省略了一些异常判断
return substr($recvData, $this->config['package_body_offset']);
问题
收发包操作频繁,一方面增加理解难度,另一方面也会带来一些性能损耗
改进
底层在内置pack和unpack方法
$client->send(package_pack($sendData));
$recvData = package_unpack($client->recv);
选项
无
The text was updated successfully, but these errors were encountered: