summaryrefslogtreecommitdiffstats
path: root/tokio/src/net/mod.rs
AgeCommit message (Collapse)Author
2020-12-11net: remove empty udp module (#3260)Evan Cameron
2020-10-12meta: combine `net` and `dns`, use `parking_lot` (#2951)Carl Lerche
This combines the `dns` and `net` feature flags. Previously, `dns` was included as part of `net`. Given that is is rare that one would want `dns` without `net`, DNS is now entirely gated w/ `net`. The `parking_lot` feature is included as part of `full`. Some misc docs are tweaked to reflect feature flag changes.
2020-10-13net: merge tcp, udp, uds features to net feature (#2943)Taiki Endo
2020-10-07net: add `TcpSocket` for configuring a socket (#2920)Carl Lerche
This enables the caller to configure the socket and to explicitly bind the socket before converting it to a `TcpStream` or `TcpListener`. Closes: #2902
2020-09-28Seal ToSocketAddrs methods with an internal argument (#2892)Sean McArthur
Closes #2891
2020-07-24net: ensure that unix sockets have both split and into_split (#2687)Alice Ryhl
The documentation build failed with errors such as error: `[read]` public documentation for `take` links to a private item --> tokio/src/io/util/async_read_ext.rs:1078:9 | 1078 | / /// Creates an adaptor which reads at most `limit` bytes from it. 1079 | | /// 1080 | | /// This function returns a new instance of `AsyncRead` which will read 1081 | | /// at most `limit` bytes, after which it will always return EOF ... | 1103 | | /// } 1104 | | /// ``` | |_______________^ | note: the lint level is defined here --> tokio/src/lib.rs:13:9 | 13 | #![deny(intra_doc_link_resolution_failure)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: the link appears in this line: bytes read and future calls to [`read()`][read] may succeed.
2019-12-22doc: fill out `fs` and remove html links (#2015)Carl Lerche
also add an async version of `fs::canonicalize`
2019-12-21dns: provide `lookup_host` function (#1870)David Barsky
`ToSocketAddrs` is a sealed trait pending changes in Rust that will allow defining async trait fns. Until then, `net::lookup_host` is provided as a way to convert a `T: ToSocketAddrs` into `SocketAddr`s.
2019-11-27doc: misc API documentation fixes (#1834)Oleg Nosov
2019-11-25doc: add more doc_cfg annotations (#1821)Carl Lerche
Also makes the `tokio::net::{tcp, udp, unix}` modules only for "utility" types. The primary types are in `tokio::net` directly.
2019-11-21runtime: cleanup and add config options (#1807)Carl Lerche
* runtime: cleanup and add config options This patch finishes the cleanup as part of the transition to Tokio 0.2. A number of changes were made to take advantage of having all Tokio types in a single crate. Also, fixes using Tokio types from `spawn_blocking`. * Many threads, one resource driver Previously, in the threaded scheduler, a resource driver (mio::Poll / timer combo) was created per thread. This was more or less fine, except it required balancing across the available drivers. When using a resource driver from **outside** of the thread pool, balancing is tricky. The change was original done to avoid having a dedicated driver thread. Now, instead of creating many resource drivers, a single resource driver is used. Each scheduler thread will attempt to "lock" the resource driver before parking on it. If the resource driver is already locked, the thread uses a condition variable to park. Contention should remain low as, under load, the scheduler avoids using the drivers. * Add configuration options to enable I/O / time New configuration options are added to `runtime::Builder` to allow enabling I/O and time drivers on a runtime instance basis. This is useful when wanting to create lightweight runtime instances to execute compute only tasks. * Bug fixes The condition variable parker is updated to the same algorithm used in `std`. This is motivated by some potential deadlock cases discovered by `loom`. The basic scheduler is fixed to fairly schedule tasks. `push_front` was accidentally used instead of `push_back`. I/O, time, and spawning now work from within `spawn_blocking` closures. * Misc cleanup The threaded scheduler is no longer generic over `P :Park`. Instead, it is hard coded to a specific parker. Tests, including loom tests, are updated to use `Runtime` directly. This provides greater coverage. The `blocking` module is moved back into `runtime` as all usage is within `runtime` itself.
2019-11-20Refactor the I/O driver, extracting slab to `tokio::util`. (#1792)Carl Lerche
The I/O driver is made private and moved to `tokio::io::driver`. `Registration` is moved to `tokio::io::Registration` and `PollEvented` is moved to `tokio::io::PollEvented`. Additionally, the concurrent slab used by the I/O driver is cleaned up and extracted to `tokio::util::slab`, allowing it to eventually be used by other types.
2019-11-18chore: refine feature flags (#1785)Carl Lerche
Removes dependencies between Tokio feature flags. For example, `process` should not depend on `sync` simply because it uses the `mpsc` channel. Instead, feature flags represent **public** APIs that become available with the feature enabled. When the feature is not enabled, the functionality is removed. If another Tokio component requires the functionality, it is stays as `pub(crate)`. The threaded scheduler is now exposed under `rt-threaded`. This feature flag only enables the threaded scheduler and does not include I/O, networking, or time. Those features must be explictly enabled. A `full` feature flag is added that enables all features. `stdin`, `stdout`, `stderr` are exposed under `io-std`. Macros are used to scope code by feature flag.
2019-10-25net: move into tokio crate (#1683)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.