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

set_socket_non_blocking() is commented out in udpstream.c #60

Open
wilsonNg007 opened this issue Jun 10, 2021 · 5 comments
Open

set_socket_non_blocking() is commented out in udpstream.c #60

wilsonNg007 opened this issue Jun 10, 2021 · 5 comments

Comments

@wilsonNg007
Copy link

In udpstream.c, the set_socket_non_blocking() call is commented out. Any reason why?

I thought non-blocking I/O is the only default I/O model implemented ntttcp-for-linux, and it is better for Tput performance (than blocking I/O). The tcp mode is still setting non-blocking socket mode.

Can we uncomment it?

@wilsonNg007
Copy link
Author

@glima , do you know why?

@glima
Copy link

glima commented Jun 10, 2021

@simonxiaoss seems to the one last editing those bits (and to be honest I barely know this code base)

@wilsonNg007
Copy link
Author

Thanks @glima. I also noticed from "Add support for UDP in IPv4" PR (June 25,2016) which added the udpstream source files, that set_socket_non_blocking code was already commented out from the beginning. It's never been enabled.

@simonxiaoss, is there any concern if non_blocking socket mode is enabled for UDP ?

@simonxiaoss
Copy link
Member

To be frankly, the UDP processing is not completely implemented and not well tested. This initial version is just a simple duplication of the TCP stream with blocking mode.

Yes, we should set the UDP socket as "O_NONBLOCK", and also handle it properly when we receive the data.

We should combine the code and use a unified way to process TCP/UDP too.

@wilsonNg007
Copy link
Author

Hi @santoshx ,

I recalled you have worked on this trying to enable nonblocking mode for UDP socket, but you encountered some issue. Do you have any update? Thanks.

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

3 participants