about summary refs log tree commit diff
path: root/src/libstd/net/tcp.rs
AgeCommit message (Collapse)AuthorLines
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-3/+3
2019-03-25SGX target: fix std unit testsJethro Beekman-15/+47
2019-03-08std: Delete a by-definition spuriously failing testAlex Crichton-15/+0
This commit deletes the `connect_timeout_unbound` test from the standard library which, unfortunately, is by definition eventually going to be a spuriously failing test. There's no way to reserve a port as unbound so we can rely on ecosystem testing for this feature for now. Closes #52590
2019-02-28libstd => 2018Taiki Endo-15/+15
2019-02-26Auto merge of #58357 - sfackler:vectored-io, r=alexcrichtonbors-2/+67
Add vectored read and write support This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies. r? @alexcrichton
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-2/+2
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-2/+2
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-18Merge remote-tracking branch 'upstream/master'Stein Somers-4/+4
2019-02-18Explain a panic in test case net::tcp::tests::double_bindStein Somers-2/+6
2019-02-13Add vectored read and write supportSteven Fackler-2/+67
This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies.
2019-02-10libs: doc commentsAlexander Regueiro-4/+4
2019-01-14Remove the `connect_timeout_unroutable` test.Nicholas Nethercote-11/+0
It requires an unreachable IP address, but there is no such thing, and this has caused it to fail for multiple people. Fixes #44698, fixes #50065.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-11Address unused variables warning with TcpStreamvarkor-0/+3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-11-30Deal with EINTR in net timeout testsJosh Stone-4/+6
We've seen sporadic QE failures in the timeout tests on this assertion: assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); So there's an error, but not either of the expected kinds. Adding a format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). For the cases that were using `read`, we can just use `read_exact` to keep trying after interruption. For those using `recv_from`, we have to manually loop until we get a non-interrupted result.
2018-10-11Small changes to fix documentation auto compile issuesCharles Hathaway-1/+2
2018-10-10update tcp stream documentationCharles Hathaway-4/+3
2018-07-25Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and ↵Tatsuyuki Ishi-1/+1
'ljedrz/dyn_libterm' into dyn-rollup
2018-07-17Fix doc comment: use `?` instead of `.unwrap()`Felix Rabe-1/+1
2018-07-11Add missing dyn in testsljedrz-1/+1
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-8/+8
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-02Rollup merge of #48328 - frewsxcv:frewsxcv-clarify-error-zero-duration, ↵Manish Goregaokar-4/+35
r=sfackler Fixes #47311. r? @nrc
2018-02-25Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfacklerkennytm-0/+20
Add tests ensuring zero-Duration timeouts result in errors; fix Redox issues. Part of #48311
2018-02-24Clarify "It is an error to..." wording for zero-duration behaviors.Corey Farwell-4/+35
Documentation fix side of https://github.com/rust-lang/rust/issues/48311.
2018-02-18Add tests ensuring zero-Duration timeouts result in errors.Corey Farwell-0/+20
Part of https://github.com/rust-lang/rust/issues/48311
2018-02-17Unify 'Platform-specific behavior' documentation headings.Corey Farwell-4/+4
2018-01-11Make tests build on CloudABI.Ed Schouten-1/+1
There are some tests that need to be disabled on CloudABI specifically, due to the fact that the shims cannot be built in combination with unix::ext or windows::ext. Also improve the scoping of some imports to suppress compiler warnings.
2017-10-21Rollup merge of #45227 - frewsxcv:frewsxcv-set-nonblocking, r=sfacklerCorey Farwell-7/+66
Expand docs/examples for TCP `set_nonblocking` methods. Part of https://github.com/rust-lang/rust/issues/44050.
2017-10-21Expand docs/examples for TCP `set_nonblocking` methods.Corey Farwell-7/+66
Part of https://github.com/rust-lang/rust/issues/44050.
2017-10-14Fix TcpStream::connect_timeout on linuxSteven Fackler-0/+15
Linux appears to set POLLOUT when a conection's refused, which is pretty weird. Invert the check to look for an error explicitly. Also add an explict test for this case. Closes #45265.
2017-10-07Auto merge of #44913 - leavehouse:patch-1, r=BurntSushibors-3/+3
Fix TcpStream::local_addr docs example code The local address's port is not 8080 in this example, that's the remote peer address port. On my machine, the local address is different every time, so I've changed `assert_eq` to only test the IP address
2017-09-28Fix imports in TcpStream::local_addr docs exampleleavehouse-1/+1
Add a missing import and remove unused imports
2017-09-28Fix TcpStream::local_addr example codeleavehouse-2/+2
The local address's port is not 8080 in this example, that's the remote peer address port. On my machine, the local address is different every time, so I've changed `assert_eq` to only test the IP address
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-1/+1
This includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-17Ensure tcp test case passes when disconnected from networkTrevor Merrifield-2/+5
net::tcp::tests::connect_timeout_unroutable fails when the network is unreachable, like on a laptop disconnected from wifi. Check for this error and allow the test to pass. Closes #44645
2017-09-14stabilize tcpstream_connect_timeout (closes #43079)Michal Budzynski-1/+1
2017-08-31Expand docs of multi-address behavior of some UDP/TCP APIs.Corey Farwell-4/+44
Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-13Rollup merge of #43833 - dtolnay:connect-timeout, r=sfacklerGuillaume Gomez-1/+1
Fix TcpStream::connect_timeout tracking issue number Before: https://github.com/rust-lang/rust/pull/43709 After: https://github.com/rust-lang/rust/issues/43079 r? @sfackler
2017-08-12Fix TcpStream::connect_timeout tracking issue numberDavid Tolnay-1/+1
2017-08-12Fix some typosBastien Orivel-1/+1
2017-07-06Implement TcpStream::connect_timeoutSteven Fackler-0/+33
This breaks the "single syscall rule", but it's really annoying to hand write and is pretty foundational.
2017-06-20Add `Read::initializer`.Steven Fackler-5/+9
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
2017-05-20Stabilize library features for 1.18.0Steven Fackler-2/+1
Closes #38863 Closes #38980 Closes #38903 Closes #36648
2017-04-27Rollup merge of #41526 - steveklabnik:gh35950, r=GuillaumeGomezCorey Farwell-9/+8
Clean up TcpStream example Fixes #35950
2017-04-26Address platform-specific behavior in TcpStream::shutdownsteveklabnik-0/+7
Fixes #25164
2017-04-26Clean up TcpStream examplesteveklabnik-9/+8
Fixes #35950
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