diff options
| author | bors <bors@rust-lang.org> | 2014-03-13 21:06:34 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-13 21:06:34 -0700 |
| commit | 4443fb3cfa945cf7cb791cf8f2ec81b7faf25132 (patch) | |
| tree | c8f6ce3665e52cee6b0bff3a55aa0116a61af1c6 /src/libnative | |
| parent | 98fa0f89b1cd406594bedc5803a1b6db53990a15 (diff) | |
| parent | a63deeb3d32fc21f36d484d62a3ea1d3d0c82500 (diff) | |
| download | rust-4443fb3cfa945cf7cb791cf8f2ec81b7faf25132.tar.gz rust-4443fb3cfa945cf7cb791cf8f2ec81b7faf25132.zip | |
auto merge of #12855 : alexcrichton/rust/shutdown, r=brson
This is something that is plausibly useful, and is provided by libuv. This is not currently surfaced as part of the `TcpStream` type, but it may possibly appear in the future. For now only the raw functionality is provided through the Rtio objects.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/net.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index 7445e4c0992..6a711072942 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -351,6 +351,11 @@ impl rtio::RtioTcpStream for TcpStream { fn clone(&self) -> ~rtio::RtioTcpStream { ~TcpStream { inner: self.inner.clone() } as ~rtio::RtioTcpStream } + fn close_write(&mut self) -> IoResult<()> { + super::mkerr_libc(unsafe { + libc::shutdown(self.fd(), libc::SHUT_WR) + }) + } } impl rtio::RtioSocket for TcpStream { |
