about summary refs log tree commit diff
path: root/library/std/src/os/net
AgeCommit message (Collapse)AuthorLines
2025-09-28Rollup merge of #140482 - devnexen:tcp_deferaccept_toduration, r=joboetMatthias Krüger-13/+22
std::net: update tcp deferaccept delay type to Duration. See comment [here](https://github.com/rust-lang/rust/issues/119639#issuecomment-2839330337).
2025-09-27fix build for androidDavid Carlier-0/+1
2025-09-26std::net: update tcp deferaccept delay type to Duration.David Carlier-13/+21
2025-09-06Add socket extensions for cygwinBerrysoft-3/+3
2025-07-01Update version placeholdersJosh Stone-6/+6
2025-06-09Rollup merge of #129121 - devnexen:stabilize_ext_linux_tcp_layer, r=tgross35Matthias Krüger-8/+6
Stabilize `tcp_quickack` to stabilise the quickack part for now, tcp_deferaccept had been added at a later stage. The related API calls are the following ```rust // std::os::linux::net // sealed trait, implemented for std::net::TcpStream pub trait TcpStreamExt: Sealed{ fn quickack(&self) -> io::Result<bool>; fn set_quickack(&self, quickack: bool) -> io::Result<()>; } ``` Closes: https://github.com/rust-lang/rust/issues/96256
2025-05-14Update std doctests for androidEric Huss-0/+15
This updates some doctests that fail to run on android. We will soon be supporting cross-compiled doctests, and the `arm-android` job fails to run these tests. In summary: - Android re-exports some traits from linux under a different path. - Android doesn't seem to have common unix utilities like `true`, `false`, or `whoami`, so these are disabled.
2024-08-15proposal to expand (a subset of) linux specific socket capabilities.David Carlier-8/+6
to stabilise the quickack part for now, tcp_deferaccept had been added at a later stage.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-10/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2023-10-25Convert `Unix{Datagram,Stream}::{set_}passcred()` to per-OS traitsJohn Millikin-0/+66
These methods are the pre-stabilized API for obtaining peer credentials from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature. Their current behavior is to get/set one of the `SO_PASSCRED` (Linux), `LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket options. On other targets the `{set_}passcred()` methods do not exist. There are two problems with this approach: 1. Having public methods only exist for certain targets isn't permitted in a stable `std` API. 2. These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to `recvmsg()`). Splitting into OS-specific extension traits is the preferred solution to both problems.
2024-02-21os::net: expanding TcpStreamExt for Linux with `tcp_deferaccept`.David Carlier-0/+81
allows for socket to process only when there is data to process, the option sets a number of seconds until the data is ready.
2023-04-28replace version placeholdersPietro Albini-4/+4
2023-03-18Stabilise `unix_socket_abstract`John Millikin-4/+4
Fixes https://github.com/rust-lang/rust/issues/85410
2023-01-29Rollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitorMatthias Krüger-0/+9
Disable `linux_ext` in wasm32 and fortanix rustdoc builds. The `std::os::unix` module is stubbed out when building docs for these target platforms. The introduction of Linux-specific extension traits caused `std::os::net` to depend on sub-modules of `std::os::unix`, which broke rustdoc for the `wasm32-unknown-unknown` target. Adding an additional `#[cfg]` guard solves that rustdoc failure by not declaring `linux_ext` on targets with a stubbed `std::os::unix`. Fixes #105467
2023-01-09Disable `linux_ext` in wasm32 and fortanix rustdoc builds.John Millikin-0/+9
The `std::os::unix` module is stubbed out when building docs for these target platforms. The introduction of Linux-specific extension traits caused `std::os::net` to depend on sub-modules of `std::os::unix`, which broke rustdoc for the `wasm32-unknown-unknown` target. Adding an additional `#[cfg]` guard solves that rustdoc failure by not declaring `linux_ext` on targets with a stubbed `std::os::unix`.
2023-01-04relax reference requirement on from_abstract_namemllken-1/+1
2022-09-18Move `unix_socket_abstract` feature API to `SocketAddrExt`.John Millikin-0/+67
2022-09-18Adjust `tcp_quickack` feature to allow other `os::linux::net` features.John Millikin-8/+13
2022-08-13created tcpstream quickack traitBerend-Jan Lange-0/+106
for linux and android