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

UdpSocket: please support vectored send #68617

Open
joshtriplett opened this issue Jan 28, 2020 · 3 comments
Open

UdpSocket: please support vectored send #68617

joshtriplett opened this issue Jan 28, 2020 · 3 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@joshtriplett
Copy link
Member

The UdpSocket type provides send and send_to methods, but does not provide a vectored send operation. Such an operation is particularly helpful for datagrams, where separate send operations result in separate datagrams; a vectored send allows sending data from multiple buffers in a single datagram.

This would require calling sendmsg, which supports supplying an iovec. (This should work on Windows as well.)

@joshtriplett joshtriplett added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 28, 2020
@frehberg
Copy link
Contributor

frehberg commented Feb 16, 2023

Support for method UdpSocket::send_to_vectored() would be really great

If rustlib would provide this, the feature could be lifted to mio and further to tokio-UdpSocket

frehberg added a commit to frehberg/rust that referenced this issue Feb 16, 2023
@frehberg
Copy link
Contributor

frehberg commented Feb 16, 2023

Request for Comments:

I need the functionality UdpSocket::send_to_vectored() in rustlib, then mio and finally in tokio::net

To start with I did a first sketch in rustlib implementing UdpSocket::send_to_vectored() for unix.

Please tell me, if this is heading into the right direction, I would add further code for other target systems, docs and tests
#108120

If this functionality makes it into rustlib, then I will go another layer up in software stack, adding the functionality to mio.

@workingjubilee
Copy link
Member

I'm concerned the proposed API has the problem where UDP datagrams tend to resist splitting-up by the protocol, so someone might use send_to_vectored and easily overflow the maximum size of the datagram.

Anyways, please file an API Change Proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants