Skip to main content

Crate ntex_net

Crate ntex_net 

Source
Expand description

Network transports and runtime reactor integration for ntex.

This crate provides TCP and Unix domain socket connection helpers, DNS-aware connectors, and reactor implementations for native ntex, Tokio, and Compio runtimes. All transports are exposed as [Io] values.

DefaultRuntime selects a reactor from the enabled Cargo features and the current platform.

§Runtime features

  • tokio enables the Tokio reactor.
  • compio enables the Compio reactor.
  • neon-polling requires the native polling reactor on Unix.
  • neon-uring requires the native io-uring reactor on Linux.

Without an explicit runtime feature, Linux tries io-uring and falls back to polling; other Unix platforms use polling and Windows always uses IOCP.

Modules§

channel
A one-shot, futures-aware channel.
connect
DNS-aware TCP connector service.
polling
tokio
uring

Structs§

DefaultRuntime
The default runtime.
Listener
TCP listener that accepts connections through the current reactor.

Traits§

Reactor
Runtime reactor used for network connection and transport operations.

Functions§

from_tcp_stream
Converts a standard-library TCP stream into an [Io] value.
from_unix_stream
Converts a standard-library Unix stream into an [Io] value.
is_tcp_listener_supported
Returns true if the current reactor supports tcp_listener.
tcp_connect
Opens a TCP connection to a remote host.
tcp_listener
Registers a TCP listener with the current reactor.
unix_connect
Opens a Unix domain socket connection.
with_reactor
Sets the current reactor and runs the provided closure.