about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2017-09-08Add feature gate to doctests.J. Cliff Dyer-0/+4
2017-09-07Close doc examples and trim whitespace.J. Cliff Dyer-1/+5
2017-09-07IP address convenience constructorsJ. Cliff Dyer-0/+68
2017-09-07Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`Tobias Bucher-16/+9
2017-08-31Rollup merge of #44209 - frewsxcv:frewsxcv-addr-other-scenarios, r=alexcrichtonMark Simulacrum-6/+92
Expand docs of multi-address behavior of some UDP/TCP APIs. Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-31Expand docs of multi-address behavior of some UDP/TCP APIs.Corey Farwell-6/+92
Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-30Fix typo in doc `ToSocketAddrs` example.Corey Farwell-1/+1
2017-08-28Rewrite `std::net::ToSocketAddrs` doc examples.Corey Farwell-22/+66
in particular: * show how to create an iterator that yields multiple socket addresses * show more failing scenarios
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-2/+2
2017-08-07Stop using URL shortener in docsOliver Middleton-1/+1
tidy will no longer complain about long lines containing links so there is no reason to use a URL shortener here.
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-21Auto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichtonbors-6/+3
Stabilize library features for 1.18.0 Closes #38863 Closes #38980 Closes #38903 Closes #36648 r? @alexcrichton @rust-lang/libs
2017-05-20Stabilize library features for 1.18.0Steven Fackler-6/+3
Closes #38863 Closes #38980 Closes #38903 Closes #36648
2017-05-20Correct some stability versionsOliver Middleton-9/+9
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
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-27Addressed requested changes for PR #40838lukaramu-26/+17
* Fixed spelling ToSocketAddr -> ToSocketAddrs in module docs (which also fixes a link) * Added missing "when" before "interacting" in module docs * Changed SocketAddr's top-level docs to explicitly state what socket addresses consist of, making them more consistent with SocketAddrV4's and SocketAddrV6's docs * Changed "in C" -> "in C's `netinet/in.h`" * Changed wording in is_ipv4/is_ipv6 methods to ", `false` otherwise" * Add missing closing ` ``` ` in Ipv6Addr's examples * Removed "Errors" section in ToSocketAddrs' to_socket_addrs method as it was rather redundant
2017-03-26fix trailing whitespacelukaramu-1/+1
2017-03-26Expanded std::net module docslukaramu-0/+26
Part of #29363
2017-03-26Expanded top-level docs for std::net{TcpListener,TcpStream,UdpSocket}lukaramu-9/+58
Part of #29363
2017-03-26Added links to std::net::Shutdown docs and made them more consistentlukaramu-6/+19
Part of #29363
2017-03-26Added examples to std::net::{SocketAddr, SocketAddrV4, SocketAddrV6} docslukaramu-0/+36
2017-03-26Expanded and added links to std::net::{SocketAddr,SocketAddrV4,SocketAddrV6} ↵lukaramu-26/+90
docs Part of #29363 Changed summary sentences of SocketAddr and IpAddr for consistency Linked to SocketAddrV4 and SocketAddrV6 from SocketAddr, moving explaination there Expanded top-level docs for SocketAddrV4 and SocketAddrV6, linking to some relevant IETF RFCs, and linking back to SocketAddr Changed some of the method summaries to third person as per RFC 1574; added links to IETF RFCs where appropriate
2017-03-26Removed link in std::net::ToSocketAddr's summary sentencelukaramu-3/+1
Relative links in trait methods don't resolve in e.g. std/primitive.tuple.html :(
2017-03-26Expanded and added links to std::net::{IpAddr,Ipv4Addr,Ipv6Addr} docslukaramu-42/+160
Part of #29363 Expanded top-level documentation & linked to relevant IETF RFCs. Added a bunch of links (to true/false/Ipv4Addr/etc.) throughout the docs.
2017-03-26Added links to std::net::AddrParseError's documentationlukaramu-1/+13
Additionally changed the summary sentence to be more consistent with most of the other FromStr implementations' error types.
2017-03-26Added links throughout std::net::ToSocketAddrs' documentationlukaramu-17/+35
Part of #29363 In the section about the default implementations of ToSocketAddrs, I moved the bulletpoint of SocketAddrV4 & SocketAddrV6 to the one stating that SocketAddr is constructed trivially, as this is what's actually the case
2017-03-26std::net docs: changed occurences of "RFC" to say "IETF RFC"lukaramu-24/+24
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-19Rollup merge of #40590 - z1mvader:master, r=steveklabnikCorey Farwell-0/+2
documented order of conversion between u32 an ipv4addr This fixes https://github.com/rust-lang/rust/issues/40118
2017-03-16documented order of conversion between u32 an ipv4addrz1mvader-0/+2
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-19/+19
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-07Rollup merge of #39372 - seanmonstar:more-addr-froms, r=alexcrichtonCorey Farwell-0/+29
A few ergonomic From impls for SocketAddr/IpAddr My main motivation is removing things like this: `"127.0.0.1:3000".parse().unwrap()`. Instead, this now works: `SocketAddr::from(([127, 0, 0, 1], 3000))` or even `([127, 0, 0, 1], 3000).into())` when passing to a function.
2017-02-05Ipv6Addr <-> u128Clar Charr-4/+36
2017-02-05Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichtonCorey Farwell-1/+4
Fix a few impl stability attributes The versions show up in rustdoc.
2017-02-05Rollup merge of #38983 - APTy:udp-peek, r=aturonCorey Farwell-0/+151
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/+151
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-31add From<(I, u16)> for SocketAddr where I: Into<IpAddr>Sean McArthur-2/+9
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+4
The versions show up in rustdoc.
2017-01-28add From<[u8; n]> impls for IpAddrSean McArthur-0/+22
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-12/+4
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-24Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichtonbors-0/+20
impl ToSocketAddrs for String `ToSocketAddrs` is implemented for a number of different types, including `(IpAddr, u16)`, `&str`, and various others, for the convenience of being able to run things like `TcpListener::bind("10.11.12.13:1415")`. However, because this is a generic parameter with a trait bound, if you have a `String` you cannot pass it in, either directly as `TcpListener::bind(string)`, or the `TcpListener::bind(&string)` as you might expect due to deref coercion; you have to use `TcpListener::bind(&*string)`, which is noisy and hard to discover (though #39029 suggests better error messages to make it more discoverable). Rather than making people stumble over this, just implement `ToSocketAddrs` for `String`.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-4/+4
See #38644.
2017-01-20Rollup merge of #39120 - alexcrichton:emscripten-tests, r=brsonAlex Crichton-1/+1
travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling