• Home
Name
Date
Size
#Lines
LOC

..--

src/03-May-2024-5,7903,831

.cargo_vcs_info.jsonD03-May-202494 66

Android.bpD03-May-20242 KiB6258

Cargo.tomlD03-May-20241.5 KiB6962

Cargo.toml.origD03-May-20241.1 KiB4438

LICENSED03-May-202410.6 KiB202169

LICENSE-APACHED03-May-202410.6 KiB202169

LICENSE-MITD03-May-20241 KiB2622

METADATAD03-May-2024674 2422

MODULE_LICENSE_APACHE2D03-May-20240

OWNERSD03-May-202447 21

README.mdD03-May-20242.5 KiB8558

TEST_MAPPINGD03-May-2024444 2423

cargo2android.jsonD03-May-2024250 1413

README.md

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# Two branches
23
24Currently Socket2 supports two versions: v0.4 and v0.3. Version 0.4 is developed
25in 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
31Socket2 attempts to support the same OS/architectures as Rust does, see
32https://doc.rust-lang.org/nightly/rustc/platform-support.html. However this is
33not 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
42These OSs are tested with each commit in the CI and must always pass the tests.
43All functions/types/etc., excluding ones behind the `all` feature, must work on
44these OSs.
45
46* Linux
47* macOS
48* Windows
49
50### Tier 2
51
52These OSs are currently build in the CI, but not tested. Not all
53functions/types/etc. may work on these OSs, even ones **not** behind the `all`
54feature flag.
55
56* Android
57* FreeBSD
58* Fuchsia
59* iOS
60* illumos
61* NetBSD
62* Redox
63* Solaris
64
65# Minimum Supported Rust Version (MSRV)
66
67Socket2 uses 1.46.0 as MSRV.
68
69# License
70
71This project is licensed under either of
72
73 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
74   https://www.apache.org/licenses/LICENSE-2.0)
75 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
76   https://opensource.org/licenses/MIT)
77
78at your option.
79
80### Contribution
81
82Unless you explicitly state otherwise, any contribution intentionally submitted
83for inclusion in this project by you, as defined in the Apache-2.0 license,
84shall be dual licensed as above, without any additional terms or conditions.
85