1b8a62b91Sopenharmony_ci//! Network-related operations. 2b8a62b91Sopenharmony_ci//! 3b8a62b91Sopenharmony_ci//! On Windows, one must call [`wsa_startup`] in the process before calling any 4b8a62b91Sopenharmony_ci//! of these APIs. [`wsa_cleanup`] may be used in the process if these APIs are 5b8a62b91Sopenharmony_ci//! no longer needed. 6b8a62b91Sopenharmony_ci//! 7b8a62b91Sopenharmony_ci//! [`wsa_startup`]: https://docs.rs/rustix/latest/x86_64-pc-windows-msvc/rustix/net/fn.wsa_startup.html 8b8a62b91Sopenharmony_ci//! [`wsa_cleanup`]: https://docs.rs/rustix/latest/x86_64-pc-windows-msvc/rustix/net/fn.wsa_cleanup.html 9b8a62b91Sopenharmony_ci 10b8a62b91Sopenharmony_ci#[cfg(not(feature = "std"))] 11b8a62b91Sopenharmony_cimod addr; 12b8a62b91Sopenharmony_ci#[cfg(not(feature = "std"))] 13b8a62b91Sopenharmony_cimod ip; 14b8a62b91Sopenharmony_cimod send_recv; 15b8a62b91Sopenharmony_cimod socket; 16b8a62b91Sopenharmony_cimod socket_addr_any; 17b8a62b91Sopenharmony_ci#[cfg(not(any(windows, target_os = "wasi")))] 18b8a62b91Sopenharmony_cimod socketpair; 19b8a62b91Sopenharmony_ci#[cfg(windows)] 20b8a62b91Sopenharmony_cimod wsa; 21b8a62b91Sopenharmony_ci 22b8a62b91Sopenharmony_cipub mod sockopt; 23b8a62b91Sopenharmony_ci 24b8a62b91Sopenharmony_cipub use send_recv::{ 25b8a62b91Sopenharmony_ci recv, recvfrom, send, sendto, sendto_any, sendto_v4, sendto_v6, RecvFlags, SendFlags, 26b8a62b91Sopenharmony_ci}; 27b8a62b91Sopenharmony_cipub use socket::{ 28b8a62b91Sopenharmony_ci accept, accept_with, acceptfrom, acceptfrom_with, bind, bind_any, bind_v4, bind_v6, connect, 29b8a62b91Sopenharmony_ci connect_any, connect_v4, connect_v6, getpeername, getsockname, listen, shutdown, socket, 30b8a62b91Sopenharmony_ci socket_with, AcceptFlags, AddressFamily, Protocol, Shutdown, SocketFlags, SocketType, 31b8a62b91Sopenharmony_ci}; 32b8a62b91Sopenharmony_cipub use socket_addr_any::{SocketAddrAny, SocketAddrStorage}; 33b8a62b91Sopenharmony_ci#[cfg(not(any(windows, target_os = "wasi")))] 34b8a62b91Sopenharmony_cipub use socketpair::socketpair; 35b8a62b91Sopenharmony_ci#[cfg(feature = "std")] 36b8a62b91Sopenharmony_cipub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; 37b8a62b91Sopenharmony_ci#[cfg(windows)] 38b8a62b91Sopenharmony_cipub use wsa::{wsa_cleanup, wsa_startup}; 39b8a62b91Sopenharmony_ci#[cfg(not(feature = "std"))] 40b8a62b91Sopenharmony_cipub use { 41b8a62b91Sopenharmony_ci addr::{SocketAddr, SocketAddrV4, SocketAddrV6}, 42b8a62b91Sopenharmony_ci ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope}, 43b8a62b91Sopenharmony_ci}; 44b8a62b91Sopenharmony_ci#[cfg(unix)] 45b8a62b91Sopenharmony_cipub use { 46b8a62b91Sopenharmony_ci send_recv::sendto_unix, 47b8a62b91Sopenharmony_ci socket::{bind_unix, connect_unix, SocketAddrUnix}, 48b8a62b91Sopenharmony_ci}; 49