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

支持0长度的UDP包 support 0-length UDP packet #541

Open
kahotv opened this issue May 9, 2024 · 3 comments
Open

支持0长度的UDP包 support 0-length UDP packet #541

kahotv opened this issue May 9, 2024 · 3 comments

Comments

@kahotv
Copy link

kahotv commented May 9, 2024

UDP协议本身是支持0长度UDP包的,且我在工作中踩到过这个坑。
测试发现udp_echo_server.c不能收到0长度的UDP包,希望能支持一下,感谢!

@xs-411
Copy link

xs-411 commented May 10, 2024

0长度的udp包,是指接收端不知道长度吗?

@kahotv
Copy link
Author

kahotv commented May 10, 2024

0长度的udp包,是指接收端不知道长度吗?

字面意义的0长度,这样发给接收端,接收端echo没任何打印
sendto(fd, "", 0, 0, &addr, sizeof(addr));

@xs-411
Copy link

xs-411 commented May 14, 2024

0长度的udp包,是指接收端不知道长度吗?

字面意义的0长度,这样发给接收端,接收端echo没任何打印 sendto(fd, "", 0, 0, &addr, sizeof(addr));

我知道你的意思了,就是发送0数据。

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