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 is missing close_{read,write} #14926

Closed
alexcrichton opened this issue Jun 16, 2014 · 7 comments
Closed

UdpSocket is missing close_{read,write} #14926

alexcrichton opened this issue Jun 16, 2014 · 7 comments

Comments

@alexcrichton
Copy link
Member

These weren't added recently, and I don't think there's a fundamental reason for not offering this, so we should probably offer it.

@LorenVS
Copy link

LorenVS commented Jun 17, 2014

I began working on this issue. My work in progress is at 68bf86e. It seems like getting libnative working properly won't be that difficult but I'm pretty lost when it comes to libgreen. Any pointers on what is necessary there?

@alexcrichton
Copy link
Member Author

The relevant file would be src/librustuv/net.rs and I would take a look at the implementation for TCP streams. You'll also find some relevant bits in src/librustuv/timeout.rs and src/librustuv/stream.rs (although timeouts may not be too relevant).

Thinking about it a bit, I'm not sure if it makes sense to provide a close_write method because I'm not sure that UDP can actually block in a call to sendto. There's no acknowledgement of a packet being sent, so I'd be under the impression that it's a fire-and-forget situation.

@LorenVS
Copy link

LorenVS commented Jun 17, 2014

Would it be preferable to just replace close_read/close_write with a single close that uses SHUTDOWN_BOTH?

@alexcrichton
Copy link
Member Author

A single close method has a weighty name and raises questions why none of the other I/O primitives carry the same method. It may be best to add an #[unstable] close_read method for now because we're likely to keep the functionality but may want to change the name in the future.

@alexcrichton
Copy link
Member Author

This is being handled by rust-lang/rfcs#807.

@LorenVS
Copy link

LorenVS commented Mar 8, 2015

I think this issue might need to be re-opened... As part of the IO reform, I believe a shutdown method was supposed to be added to UdpSocket (the docs for std::io::Shutdown mention that it should exist). However, the method doesn't exist yet, and rfc 807 appears to be closed

@alexcrichton
Copy link
Member Author

Oops yes this is definitely an oversight, I've opened a new issue as this isn't quite appropriate any more.

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