about summary refs log tree commit diff
path: root/src/libstd/net/tcp.rs
AgeCommit message (Collapse)AuthorLines
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
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