about summary refs log tree commit diff
path: root/src/libstd/net/tcp.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-1844/+0
2020-07-02libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)]Yashhwanth Ram-2/+5
Enclose unsafe operations in unsafe blocks
2020-04-26Update nameSteven Fackler-8/+8
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+20
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2020-01-06Removed module usage.Strømberg-1/+0
2020-01-06Missing module std in example.Strømberg-1/+1
2019-12-14Delete flaky test net::tcp::tests::fast_rebindDavid Tolnay-15/+0
2019-11-29Format libstd with rustfmtDavid Tolnay-93/+146
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-08-22VxWorks ignores the SO_SNDTIMEO socket option (this is long-standingSalim Nasser-1/+2
behavior), so skip the following tests: net::tcp::tests::timeouts net::udp::tests::timeouts
2019-05-13Remove bitrig support from rustMarcel Hellwig-2/+2
2019-04-27Stabilized vectored IOSteven Fackler-8/+8
This renames `std::io::IoVec` to `std::io::IoSlice` and `std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes `std::io::IoSlice`, `std::io::IoSliceMut`, `std::io::Read::read_vectored`, and `std::io::Write::write_vectored`. Closes #58452
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