about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2017-01-19travis: Get an emscripten builder onlineAlex Crichton-1/+1
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
2017-01-19Auto merge of #38464 - clarcharr:ip_cmp, r=sfacklerbors-4/+100
PartialEq and PartialOrd between IpAddr and Ipv[46]Addr. PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.
2017-01-13impl ToSocketAddrs for StringBrian Campbell-0/+20
`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-13Rollup merge of #38986 - APTy:fix-nonblocking-test, r=aturonGuillaume Gomez-4/+16
std/net/udp: Improve set_nonblocking test While writing a separate change, I noticed the current test for `UdpSocket::set_nonblocking()` is fairly ineffective. This fixes the test so that it validates that a correct error is returned on calls to `recv()` when no data is available.
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-10std/net/udp: Improve set_nonblocking testTyler Julian-4/+16
2017-01-10Rollup merge of #38799 - minaguib:patch-1, r=steveklabnikSeo Sanghyeon-1/+1
Doc fix
2017-01-07Auto merge of #38327 - Yamakaky:into-ipaddr, r=brsonbors-0/+28
Impl From<Ipv4Addr, Ipv6Addr> for IpAddr. Fixes https://github.com/rust-lang/rfcs/issues/1816.
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-25Impl From<inner> for IpAddr and SocketAddr.Yamakaky-0/+16
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-24Impl From<Ipv4Addr, Ipv6Addr> for IpAddr.Yamakaky-0/+12
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-23Comparison between IpAddr and Ipv[46]Addr.Clar Charr-4/+100
2016-12-20Rollup merge of #38131 - clarcharr:from_segments, r=alexcrichtonAlex Crichton-1/+27
Add From<[u16; 8]> to Ipv6Addr Not really sure that this requires an RFC, but I figured that I'd offer a pull request and see what people think. It seems like a reasonable addition.
2016-12-18From<[u16; 8]> for Ipv6Addr.Clar Charr-1/+27
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+9
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-12Rollup merge of #38067 - GuillaumeGomez:udp-doc, r=frewsxcv,nagisaCorey Farwell-1/+58
Add more examples to UpdSocket r? @frewsxcv
2016-12-04Add more examples to UpdSocketGuillaume Gomez-1/+58
2016-12-03Rollup merge of #38077 - GuillaumeGomez:ipaddr_doc, r=frewsxcvCorey Farwell-0/+88
Add missing examples for IpAddr enum r? @frewsxcv
2016-12-03Rollup merge of #38020 - GuillaumeGomez:udp-socket-doc, r=frewsxcvCorey Farwell-11/+215
Add part of missing UdpSocket's urls and examples r? @frewsxcv
2016-12-03Rollup merge of #37859 - GuillaumeGomez:net_examples, r=nagisaCorey Farwell-0/+158
Add missing examples for Ipv6Addr r? @steveklabnik cc @frewsxcv
2016-11-29Add missing examples for IpAddr enumGuillaume Gomez-0/+88
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-26Auto merge of #38004 - GuillaumeGomez:tcp_stream_doc, r=frewsxcvbors-8/+185
Add missing urls and examples to TcpStream r? @frewsxcv
2016-11-26Add part of missing UdpSocket's urls and examplesGuillaume Gomez-11/+215
2016-11-26Rollup merge of #37962 - GuillaumeGomez:socket-v6, r=frewsxcvSeo Sanghyeon-0/+84
Add missing examples to SocketAddrV6 r? @steveklabnik cc @frewsxcv
2016-11-25Add missing urls and examples to TcpStreamGuillaume Gomez-8/+185
2016-11-23Add missing examples to SocketAddrV6Guillaume Gomez-0/+84
2016-11-23Add ::1 example in IPv6 to IPv4 conversionGuillaume Gomez-15/+44
2016-11-22Add missing examples for Ipv6AddrGuillaume Gomez-0/+129
2016-11-21Add missing examples for SocketAddrV4Guillaume Gomez-0/+46
2016-11-19Add missing examples in SocketAddrGuillaume Gomez-1/+78
2016-11-16Add examples for Ipv4AddrGuillaume Gomez-1/+124
2016-11-16Add missing urls and improve internal doc representationGuillaume Gomez-6/+21
2016-11-09Clarify that send_to might return an error in certain casesAbhishek Chanda-0/+3
Closes #34202
2016-10-12Auto merge of #36762 - achanda:sockaddr_type, r=alexcrichtonbors-0/+35
Add two functions to check type of SockAddr These can be used to determine the type of the underlying IP address r? @alexcrichton
2016-10-10Auto merge of #36707 - achanda:ip_type, r=alexcrichtonbors-0/+32
Add two functions to check type of given address The is_v4 function returns true if the given IP is v4. The is_v6 function returns true if the IP is v6.
2016-10-04Rollup merge of #36902 - ollie27:stab_impls, r=alexcrichtonManish Goregaokar-3/+2
std: Correct stability attributes for some implementations These are displayed by rustdoc so should be correct.
2016-10-03Add two functions to check type of SockAddrAbhishek Chanda-0/+35
These can be used to determine the type of the underlying IP address
2016-10-03Add two functions to check type of given addressAbhishek Chanda-0/+32
The is_v4 function returns true if the given IP is v4. The is_v6 function returns true if the IP is v6.
2016-10-02Add a platform-abstraction tidy scriptBrian Anderson-1/+3
This is intended to maintain existing standards of code organization in hopes that the standard library will continue to be refactored to isolate platform-specific bits, making porting easier; where "standard library" roughly means "all the dependencies of the std and test crates". This generally means placing restrictions on where `cfg(unix)`, `cfg(windows)`, `cfg(target_os)` and `cfg(target_env)` may appear, the basic objective being to isolate platform-specific code to the platform-specific `std::sys` modules, and to the allocation, unwinding, and libc crates. Following are the basic rules, though there are currently exceptions: - core may not have platform-specific code - liballoc_system may have platform-specific code - liballoc_jemalloc may have platform-specific code - libpanic_abort may have platform-specific code - libpanic_unwind may have platform-specific code - other crates in the std facade may not - std may have platform-specific code in the following places - sys/unix/ - sys/windows/ - os/ There are plenty of exceptions today though, noted in the whitelist.
2016-10-01std: Correct stability attributes for some implementationsOliver Middleton-3/+2
These are displayed by rustdoc so should be correct.
2016-09-30Ignore various entire test modules on emscriptenBrian Anderson-3/+0
2016-09-30Ignore entire test modules on emscripten instead of individual testsBrian Anderson-48/+6
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+46
2016-09-22Rollup merge of #36423 - GuillaumeGomez:eq_impl, r=pnkfelixJonathan Turner-2/+2
Add missing Eq implementations Part of #36301.
2016-09-18Add missing Eq implementationsGuillaume Gomez-2/+2
2016-09-13Add doc examples for std::net::IpAddr construction.Corey Farwell-0/+18