-
Notifications
You must be signed in to change notification settings - Fork 240
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
有没有选项可以避免粘包发生,比如每次调用send #83
Comments
|
我这边维护了100个客户端,每5s同时分别给100个服务端发送心跳数据,长度是24,用wireshark抓包看到客户端有时候发出了48长度的数据 |
嗯,这极有可能是内核把我们两次send的数据合并到一个TCP报文段里了。 |
你需要自己能从48字节的数据里区分出这是两个独立的业务消息。 |
但是我们两次发送数据的时间间隔是5s钟,且设置了nodelay,还是粘到一起了 |
这个确实不好说。nodelay应该说只是一种建议。但它并不能保证一定分开为两个独立的TCP报文。 |
我们现在碰到一个问题,给100个设备同时发送数据,在接收端会看到粘包的情况
The text was updated successfully, but these errors were encountered: