3 Socket2 is a crate that provides utilities for creating and using sockets.
5 The goal of this crate is to create and use a socket using advanced
6 configuration options (those that are not available in the types in the standard
7 library) without using any unsafe code.
9 This crate provides as direct as possible access to the system's functionality
10 for sockets, this means little effort to provide cross-platform utilities. It is
11 up to the user to know how to use sockets when using this crate. *If you don't
12 know how to create a socket using libc/system calls then this crate is not for
13 you*. Most, if not all, functions directly relate to the equivalent system call
14 with no error handling applied, so no handling errors such as `EINTR`. As a
15 result using this crate can be a little wordy, but it should give you maximal
16 flexibility over configuration of sockets.
18 See the [API documentation] for more.
20 [API documentation]: https://docs.rs/socket2
24 Currently Socket2 supports two versions: v0.4 and v0.3. Version 0.4 is developed
25 in the master branch, version 0.3 in the [v0.3.x branch].
27 [v0.3.x branch]: https://github.com/rust-lang/socket2/tree/v0.3.x
31 Socket2 attempts to support the same OS/architectures as Rust does, see
32 https://doc.rust-lang.org/nightly/rustc/platform-support.html. However this is
33 not always possible, below is current list of support OSs.
35 *If your favorite OS is not on the list consider contributing it! See [issue
38 [issue #78]: https://github.com/rust-lang/socket2/issues/78
42 These OSs are tested with each commit in the CI and must always pass the tests.
43 All functions/types/etc., excluding ones behind the `all` feature, must work on
52 These OSs are currently build in the CI, but not tested. Not all
53 functions/types/etc. may work on these OSs, even ones **not** behind the `all`
67 This project is licensed under either of
69 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
70 http://www.apache.org/licenses/LICENSE-2.0)
71 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
72 http://opensource.org/licenses/MIT)
78 Unless you explicitly state otherwise, any contribution intentionally submitted
79 for inclusion in this project by you, as defined in the Apache-2.0 license,
80 shall be dual licensed as above, without any additional terms or conditions.