1# Socket2
2
3Socket2 is a crate that provides utilities for creating and using sockets.
4
5The goal of this crate is to create and use a socket using advanced
6configuration options (those that are not available in the types in the standard
7library) without using any unsafe code.
8
9This crate provides as direct as possible access to the system's functionality
10for sockets, this means little effort to provide cross-platform utilities. It is
11up to the user to know how to use sockets when using this crate. *If you don't
12know how to create a socket using libc/system calls then this crate is not for
13you*. Most, if not all, functions directly relate to the equivalent system call
14with no error handling applied, so no handling errors such as `EINTR`. As a
15result using this crate can be a little wordy, but it should give you maximal
16flexibility over configuration of sockets.
17
18See the [API documentation] for more.
19
20[API documentation]: https://docs.rs/socket2
21
22# Branches
23
24Currently Socket2 supports two versions: v0.5 and v0.4. Version 0.5 is being
25developed in the master branch. Version 0.4 is developed in the [v0.4.x branch]
26branch.
27
28[v0.4.x branch]: https://github.com/rust-lang/socket2/tree/v0.4.x
29
30# OS support
31
32Socket2 attempts to support the same OS/architectures as Rust does, see
33https://doc.rust-lang.org/nightly/rustc/platform-support.html. However this is
34not always possible, below is current list of support OSs.
35
36*If your favorite OS is not on the list consider contributing it! See [issue
37#78].*
38
39[issue #78]: https://github.com/rust-lang/socket2/issues/78
40
41### Tier 1
42
43These OSs are tested with each commit in the CI and must always pass the tests.
44All functions/types/etc., excluding ones behind the `all` feature, must work on
45these OSs.
46
47* Linux
48* macOS
49* Windows
50
51### Tier 2
52
53These OSs are currently build in the CI, but not tested. Not all
54functions/types/etc. may work on these OSs, even ones **not** behind the `all`
55feature flag.
56
57* Android
58* FreeBSD
59* Fuchsia
60* iOS
61* illumos
62* NetBSD
63* Redox
64* Solaris
65
66# Minimum Supported Rust Version (MSRV)
67
68Socket2 uses 1.63.0 as MSRV.
69
70# License
71
72This project is licensed under either of
73
74 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
75   https://www.apache.org/licenses/LICENSE-2.0)
76 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
77   https://opensource.org/licenses/MIT)
78
79at your option.
80
81### Contribution
82
83Unless you explicitly state otherwise, any contribution intentionally submitted
84for inclusion in this project by you, as defined in the Apache-2.0 license,
85shall be dual licensed as above, without any additional terms or conditions.
86