]> git.proxmox.com Git - cargo.git/blob - vendor/socket2/README.md
New upstream version 0.52.0
[cargo.git] / vendor / socket2 / README.md
1 # Socket2
2
3 Socket2 is a crate that provides utilities for creating and using sockets.
4
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.
8
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.
17
18 See the [API documentation] for more.
19
20 [API documentation]: https://docs.rs/socket2
21
22 # Two branches
23
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].
26
27 [v0.3.x branch]: https://github.com/rust-lang/socket2/tree/v0.3.x
28
29 # OS support
30
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.
34
35 *If your favorite OS is not on the list consider contributing it! See [issue
36 #78].*
37
38 [issue #78]: https://github.com/rust-lang/socket2/issues/78
39
40 ### Tier 1
41
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
44 these OSs.
45
46 * Linux
47 * macOS
48 * Windows
49
50 ### Tier 2
51
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`
54 feature flag.
55
56 * Android
57 * FreeBSD
58 * Fuchsia
59 * iOS
60 * illumos
61 * NetBSD
62 * Redox
63 * Solaris
64
65 # License
66
67 This project is licensed under either of
68
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)
73
74 at your option.
75
76 ### Contribution
77
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.