summary refs log tree commit diff
path: root/src/libstd/net/tcp.rs
AgeCommit message (Collapse)AuthorLines
2017-05-23Stabilize library features for 1.18.0Steven Fackler-2/+1
Closes #38863 Closes #38980 Closes #38903 Closes #36648
2017-04-06Fix Markdown issues in the docsOliver Middleton-2/+2
* Since the switch to pulldown-cmark reference links need a blank line before the URLs. * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
2017-03-26Expanded top-level docs for std::net{TcpListener,TcpStream,UdpSocket}lukaramu-4/+33
Part of #29363
2017-03-26Update std::net:Incoming's docs to use standard iterator boilerplatelukaramu-8/+8
Part of #29363
2017-03-26added missing links in std::net TCP docslukaramu-6/+17
part of #29363
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-9/+9
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-02-05Rollup merge of #38983 - APTy:udp-peek, r=aturonCorey Farwell-0/+54
Add peek APIs to std::net Adds "peek" APIs to `std::net` sockets, including: - `UdpSocket.peek()` - `UdpSocket.peek_from()` - `TcpStream.peek()` These methods enable socket reads without side-effects. That is, repeated calls to `peek()` return identical data. This is accomplished by providing the POSIX flag `MSG_PEEK` to the underlying socket read operations. This also moves the current implementation of `recv_from` out of the platform-independent `sys_common` and into respective `sys/windows` and `sys/unix` implementations. This allows for more platform-dependent implementations where necessary. Fixes #38980
2017-02-04libstd/net: Add `peek` APIs to UdpSocket and TcpStreamTyler Julian-0/+54
These methods enable socket reads without side-effects. That is, repeated calls to peek() return identical data. This is accomplished by providing the POSIX flag MSG_PEEK to the underlying socket read operations. This also moves the current implementation of recv_from out of the platform-independent sys_common and into respective sys/windows and sys/unix implementations. This allows for more platform-dependent implementations.
2017-01-12Auto merge of #38867 - alexcrichton:ignore-test-on-windows, r=brsonbors-0/+1
std: Ignore close_read_wakes_up on Windows It looks like in practice at least this test will not pass on Windows. Empirically it is prone to blocking forever, presumably because a call to `shutdown` doesn't actually wake up other threads on Windows. We don't document this as a guarantee for `shutdown`, nor do we internally rely on it. This test originated in a time long since passed when it was leveraged for canceling I/O, but nowadays there's nothing fancy happening in the standard library so it's not really a productive test anyway, hence just ignoring it on Windows. Closes #31657
2017-01-10Rollup merge of #38799 - minaguib:patch-1, r=steveklabnikSeo Sanghyeon-1/+1
Doc fix
2017-01-05std: Ignore close_read_wakes_up on WindowsAlex Crichton-0/+1
It looks like in practice at least this test will not pass on Windows. Empirically it is prone to blocking forever, presumably because a call to `shutdown` doesn't actually wake up other threads on Windows. We don't document this as a guarantee for `shutdown`, nor do we internally rely on it. This test originated in a time long since passed when it was leveraged for canceling I/O, but nowadays there's nothing fancy happening in the standard library so it's not really a productive test anyway, hence just ignoring it on Windows. Closes #31657
2017-01-05Deprecate TcpListener::set_only_v6Steven Fackler-32/+6
This was supposed to have been removed in #33124 but snuck through :(
2017-01-03Doc fixMina Naguib-1/+1
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+1
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-11-27Auto merge of #37983 - GuillaumeGomez:tcp_listener_doc, r=frewsxcvbors-3/+118
Add examples for TcpListener struct r? @frewsxcv
2016-11-27Add examples for TcpListener structGuillaume Gomez-3/+118
2016-11-25Add missing urls and examples to TcpStreamGuillaume Gomez-8/+185
2016-11-16Add missing urls and improve internal doc representationGuillaume Gomez-1/+2
2016-09-30Ignore entire test modules on emscripten instead of individual testsBrian Anderson-31/+1
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+30
2016-08-30doc: make TcpListener example more simpleTshepang Lekhonkhobe-8/+1
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-3/+0
2016-08-01Indicate where the `std::net::Incoming` struct is created.Corey Farwell-0/+5
2016-04-26Rollup merge of #33167 - benaryorg:master, r=alexcrichtonManish Goregaokar-0/+2
clarify documentation of TcpStream::connect() for multiple valid addresses I am not sure how the UDP part of the stdlib behaves when passing multiple valid addresses, but it should be mentioned as there are legit use cases for [`impl<'a> ToSocketAddrs for &'a [SocketAddr]`](http://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html), a TCP fallback only being one. Just a little example program for anyone willing to enhance the documentation further: ```rust use std::net::SocketAddr; use std::net::ToSocketAddrs; use std::net::TcpStream; fn main() { let v: Vec<SocketAddr> = vec! [ "127.0.0.1:1338".to_socket_addrs().unwrap().next().unwrap(), "127.0.0.1:1337".to_socket_addrs().unwrap().next().unwrap(), "127.0.0.1:1339".to_socket_addrs().unwrap().next().unwrap(), ]; let stream = TcpStream::connect(&v[..]).unwrap(); } ```
2016-04-23clarify documentation of TcpStream::connect() for multiple valid addressesbenaryorg-0/+2
Signed-off-by: benaryorg <binary@benary.org>
2016-04-20Remove IPV6_V6ONLY functionalitySteven Fackler-23/+0
These settings can only be adjusted before bind time, which doesn't make sense in the current set of functionality. These methods are stable, but haven't hit a stable release yet. Closes #33052 [breaking-change]
2016-03-27Extend linkchecker with anchor checkingmitaa-5/+5
This adds checks to ensure that: * link anchors refer to existing id's on the target page * id's are unique within an html document * page redirects are valid
2016-03-08std: Funnel read_to_end through to one locationAlex Crichton-3/+2
This pushes the implementation detail of proxying `read_to_end` through to `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle` implementations on Unix/Windows. This way intermediate layers will also be able to take advantage of this optimized implementation. This commit also adds the optimized implementation for `ChildStdout` and `ChildStderr`.
2016-03-02Fix comments and OSX buildSteven Fackler-2/+9
2016-02-28Fix windowsSteven Fackler-43/+0
Also back out keepalive support for TCP since the API is perhaps not actually what we want. You can't read the interval on Windows, and we should probably separate the functionality of turning keepalive on and overriding the interval.
2016-02-28Add TCP functionality from net2Steven Fackler-0/+231
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-11/+12
2015-11-25Fix docs for TcpListener::bindKevin Butler-1/+1
`socket_addr` was renamed to `local_addr` in 1.0beta. See: f798674b86382929ca17c88de422a6e2fdb27f2a
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+2
2015-10-19Touch up net testsarcnmx-32/+21
2015-10-13Correct spelling in docsAndrew Paseltiner-1/+1
2015-09-14Drop upper bounds on net timeout testsSteven Fackler-2/+0
Windows's scheduler apparently has "problems" unblocking calls in the asked for time period.
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-8/+16
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
2015-08-15std: Add issues to all unstable featuresAlex Crichton-7/+8
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-20/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-07-28std: Deprecate extra TcpStream/UdpSocket methodsAlex Crichton-0/+6
These methods are all covered by [RFC 1158] and are currently all available on stable Rust via the [`net2` crate][net2] on crates.io. This commit does not touch the timeout related functions as they're still waiting on `Duration` which is unstable anyway, so punting in favor of the `net2` crate wouldn't buy much. [RFC 1158]: https://github.com/rust-lang/rfcs/pull/1158 [net2]: http://crates.io/crates/net2 Specifically, this commit deprecates: * TcpStream::set_nodelay * TcpStream::set_keepalive * UdpSocket::set_broadcast * UdpSocket::set_multicast_loop * UdpSocket::join_multicast * UdpSocket::set_multicast_time_to_live * UdpSocket::set_time_to_live
2015-07-20std: Add IntoRaw{Fd,Handle,Socket} traitsAlex Crichton-2/+10
This commit is an implementation of [RFC 1174][rfc] which adds three new traits to the standard library: * `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc) * `IntoRawHandle` - implemented on Windows for files, processes, etc * `IntoRawSocket` - implemented on Windows for networking types [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md Closes #27062
2015-07-15Add specializations of read_to_end for Stdin, TcpStream and File,Alisdair Owens-0/+7
allowing them to read into a buffer containing uninitialized data, rather than pay the cost of zeroing.
2015-07-01Add netbsd amd64 supportAlex Newman-1/+1
2015-06-10disabling socking timing tests because openbsd/bitrig get/set are not ↵Dave Huseby-0/+3
congruent due to rounding errors
2015-06-07change some statics to constantsOliver 'ker' Schneider-2/+2
2015-05-29Loosen timeout restrictionsSteven Fackler-10/+6
2015-05-29Skip timeout upper bound check on windowsSteven Fackler-2/+6
2015-05-28Implement RFC 1047 - socket timeoutsSteven Fackler-0/+111
Closes #25619
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-4/+4
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.