idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::net::netconn::raw_channel Class Reference

A raw IP netconn channel. More...

Inheritance diagram for idfxx::net::netconn::raw_channel:

Public Member Functions

 raw_channel (ip_protocol protocol)
 Creates a raw IPv4 netconn for the given IP protocol.
 
 raw_channel (ip_protocol protocol, address_family fam)
 Creates a raw netconn for the given IP protocol and address family.
 

Static Public Member Functions

static result< raw_channelmake (ip_protocol protocol)
 Creates a raw IPv4 netconn for the given IP protocol.
 
static result< raw_channelmake (ip_protocol protocol, address_family fam)
 Creates a raw netconn for the given IP protocol and address family.
 

Detailed Description

A raw IP netconn channel.

The IP-layer protocol (e.g. ip_protocol::icmp) is selected at construction. Use send_to / recv_from for explicit per-message addressing, or call connect() to set a default peer.

Ownership is exclusive: the channel is non-copyable and move-only. A moved-from channel may only be destroyed, move-assigned, or queried via is_open() (→ false) and idf_handle() (→ nullptr); calling any other method on it is undefined behavior. The destructor releases the channel if open.

Definition at line 43 of file raw_channel.hpp.

Constructor & Destructor Documentation

◆ raw_channel() [1/2]

idfxx::net::netconn::raw_channel::raw_channel ( ip_protocol  protocol)
explicit

Creates a raw IPv4 netconn for the given IP protocol.

Parameters
protocolIP-layer protocol (e.g. ip_protocol::icmp).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ raw_channel() [2/2]

idfxx::net::netconn::raw_channel::raw_channel ( ip_protocol  protocol,
address_family  fam 
)

Creates a raw netconn for the given IP protocol and address family.

Parameters
protocolIP-layer protocol.
famAddress family.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

Member Function Documentation

◆ make() [1/2]

static result< raw_channel > idfxx::net::netconn::raw_channel::make ( ip_protocol  protocol)
static

Creates a raw IPv4 netconn for the given IP protocol.

Parameters
protocolIP-layer protocol.
Returns
The new channel, or an error.

◆ make() [2/2]

static result< raw_channel > idfxx::net::netconn::raw_channel::make ( ip_protocol  protocol,
address_family  fam 
)
static

Creates a raw netconn for the given IP protocol and address family.

Parameters
protocolIP-layer protocol.
famAddress family.
Returns
The new channel, or an error.

The documentation for this class was generated from the following file: