about summary refs log tree commit diff
path: root/src/libstd/sys/common/net.rs
AgeCommit message (Collapse)AuthorLines
2016-11-01std: Move sys_common to libstd/sys_commonBrian Anderson-633/+0
Make the directory structure reflect the module structure. I've always found the existing structure confusing.
2016-10-09use MSG_NOSIGNAL on all relevant platformsMathieu Poumeyrol-3/+9
2016-10-06Rollup merge of #36965 - kallisti5:master, r=alexcrichtonJonathan Turner-1/+1
Haiku: Fix IPv6 target_os check
2016-10-04Haiku: Fix IPv6 target_os checkAlexander von Gluck IV-1/+1
2016-09-28use MSG_NOSIGNAL from liblibcMathieu Poumeyrol-7/+4
2016-09-28MSG_NOSIGNAL on linuxMathieu Poumeyrol-3/+11
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-4/+4
* Hand rebased from Niels original work on 1.9.0
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-4/+0
2016-07-11std: Fix IPV6 imports for solarisJosh Stone-4/+8
Like BSDs, Solaris maps `IPV6_ADD_MEMBERSHIP` and `IPV6_DROP_MEMBERSHIP` from `IPV6_JOIN_GROUP` and `IPV6_LEAVE_GROUP` respectively.
2016-07-08Add test for std::net::lookup_host() duplicatesIvan Nejgebauer-0/+19
2016-07-07Use hints with getaddrinfo() in std::net::lokup_host()Ivan Nejgebauer-1/+11
When resolving a hostname, pass a hints struct where ai_socktype is set to SOCK_STREAM in order to eliminate repeated results for each protocol family.
2016-06-29Convert a simple tail call to a loopTobias Bucher-10/+14
2016-06-29Ignore unknown address types when looking up hostsTobias Bucher-5/+9
Previously, any function using a `ToSocketAddrs` input would fail if passed a hostname that resolves to an address type different from the ones recognized by Rust. This also changes the `LookupHost` iterator to only include the known address types, as a result, it doesn't have to return `Result`s any more, which are likely misinterpreted as failed name lookups.
2016-04-20Remove IPV6_V6ONLY functionalitySteven Fackler-18/+0
These settings can only be adjusted before bind time, which doesn't make sense in the current set of functionality. These methods are stable, but haven't hit a stable release yet. Closes #33052 [breaking-change]
2016-03-22fix alignmentJorge Aparicio-6/+6
2016-03-22try! -> ?Jorge Aparicio-39/+39
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-20Add unix socket support to the standard librarySteven Fackler-18/+3
2016-03-12std: Clean out deprecated APIsAlex Crichton-33/+3
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-08std: Funnel read_to_end through to one locationAlex Crichton-0/+4
This pushes the implementation detail of proxying `read_to_end` through to `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle` implementations on Unix/Windows. This way intermediate layers will also be able to take advantage of this optimized implementation. This commit also adds the optimized implementation for `ChildStdout` and `ChildStderr`.
2016-03-03Fix netbsdSteven Fackler-4/+4
2016-03-03Fix android buildSteven Fackler-3/+3
2016-03-02Fix comments and OSX buildSteven Fackler-3/+21
2016-02-28Fix windowsSteven Fackler-16/+7
Also back out keepalive support for TCP since the API is perhaps not actually what we want. You can't read the interval on Windows, and we should probably separate the functionality of turning keepalive on and overriding the interval.
2016-02-28Add UDP functionality from net2Steven Fackler-3/+135
2016-02-28Add TCP functionality from net2Steven Fackler-0/+79
2016-02-24std: Cap read/write limits on Windows networkingAlex Crichton-3/+7
Similar to #31825 where the read/write limits were capped for files, this implements similar limits when reading/writing networking types. On Unix this shouldn't affect anything because the write size is already a `usize`, but on Windows this will cap the read/write amounts to `i32::max_value`. cc #31841
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-0/+2
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-09std: Migrate to the new libcAlex Crichton-86/+63
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-09-08some more clippy-based improvementsAndre Bogus-1/+1
2015-09-03Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`Vadim Petrochenkov-3/+4
2015-08-23Add Send/Sync traits on LookupHost structGuillaume Gomez-0/+3
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-95/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-07-20std: Add IntoRaw{Fd,Handle,Socket} traitsAlex Crichton-0/+6
This commit is an implementation of [RFC 1174][rfc] which adds three new traits to the standard library: * `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc) * `IntoRawHandle` - implemented on Windows for files, processes, etc * `IntoRawSocket` - implemented on Windows for networking types [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md Closes #27062
2015-05-28Implement RFC 1047 - socket timeoutsSteven Fackler-7/+39
Closes #25619
2015-05-17Make debug builders take &mut self, add entries methodSteven Fackler-10/+10
[breaking-change]
2015-05-07std: Rename sys::foo2 modules to sys::fooAlex Crichton-0/+494
Now that `std::old_io` has been removed for quite some time the naming real estate here has opened up to allow these modules to move back to their proper names.
2015-04-21Remove unused filesTamir Duberstein-971/+0
Looks like these were missed in bf4e77d.
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-2/+2
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-29/+29
Now that support has been removed, all lingering use cases are renamed.
2015-03-12std: Remove #[allow] directives in sys modulesAlex Crichton-1/+5
These were suppressing lots of interesting warnings! Turns out there was also quite a bit of dead code.
2015-03-06std: Deprecate the std::old_io::net primitivesAlex Crichton-0/+2
The `std::net` primitives should be ready for use now and as a result the old ones are now deprecated and slated for removal. Most TCP/UDP functionality is now available through `std::net` but the `std::old_io::net::pipe` module is removed entirely from the standard library. Unix socket funtionality can be found in sfackler's [`unix_socket`][unix] crate and there is currently no replacement for named pipes on Windows. [unix]: https://crates.io/crates/unix_socket [breaking-change]
2015-02-23Hide unnecessary error checking from the userTobias Bucher-13/+8
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as "short UDP writes", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-21Auto merge of #21959 - dhuseby:bitrig-support, r=brsonbors-1/+2
This patch adds the necessary pieces to support rust on Bitrig https://bitrig.org
2015-02-18std: Implement CString-related RFCsAlex Crichton-6/+11
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-11bitrig integrationDave Huseby-1/+2
2015-02-04remove all kind annotations from closuresJorge Aparicio-7/+7
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-1/+1
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-02-01openbsd supportSébastien Marie-2/+8
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1