1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! A networking module for `vibeio`.
//!
//! This module provides async versions of common networking operations:
//! - TCP: [`TcpListener`], [`TcpStream`], [`PollTcpStream`]
//! - UDP: [`UdpSocket`]
//! - Unix domain sockets: [`UnixListener`], [`UnixStream`], [`PollUnixStream`]
//!
//! Implementation notes:
//! - On Linux with io_uring support, some operations use native async syscalls (e.g. `accept4`, `sendto`)
//! via the async driver. When io_uring completion is available, operations complete directly.
//! - For platforms without native async support, operations either offload to a blocking thread pool
//! or fall back to synchronous std::net calls.
//! - The runtime must be active when calling these functions; otherwise they will panic.
//!
//! # Examples
//!
//! ## TCP Server
//!
//! ```ignore
//! use vibeio::net::TcpListener;
//!
//! let listener = TcpListener::bind("127.0.0.1:8080").await?;
//! loop {
//! let (stream, addr) = listener.accept().await?;
//! println!("Connection from: {}", addr);
//! }
//! ```
//!
//! ## UDP Client
//!
//! ```ignore
//! use vibeio::net::UdpSocket;
//!
//! let socket = UdpSocket::bind("127.0.0.1:0").await?;
//! socket.connect("127.0.0.1:9000").await?;
//! socket.send(b"hello").await?;
//! ```
//!
//! ## Unix Domain Socket
//!
//! ```ignore
//! use vibeio::net::UnixStream;
//!
//! let stream = UnixStream::connect("/tmp/mysocket").await?;
//! ```
pub use *;
pub use *;
pub use *;