SocketOption

Enum SocketOption 

Source
pub enum SocketOption<'a> {
Show 23 variants ReuseAddr(i32), ReceiveTimeout(nrf_timeval), SendTimeout(nrf_timeval), BindToPdn(i32), ExceptionalData(i32), KeepOpen(i32), Rai(i32), SilenceAll(i32), IpEchoReply(i32), Ipv6EchoReply(i32), Ipv6DelayedAddrRefresh(i32), TcpServerSessionTimeout(i32), TlsHostName(&'a str), TlsPeerVerify(i32), TlsSessionCache(i32), TlsTagList(&'a [nrf_sec_tag_t]), TlsCipherSuiteList(&'a [i32]), TlsRole(i32), TlsSessionCachePurge(i32), DtlsHandshakeTimeout(i32), DtlsCid(i32), DtlsConnSave(i32), DtlsConnLoad(i32),
}
Expand description

Socket configuration options.

These options can be set using Socket::set_option to configure various aspects of socket behavior including timeouts, TLS settings, PDN binding, and protocol-specific options.

Variants§

§

ReuseAddr(i32)

Non-zero requests reuse of local addresses in bind (protocol-specific).

§

ReceiveTimeout(nrf_timeval)

Timeout value for socket receive and accept operations.

Minimum supported resolution is 1 millisecond.

§

SendTimeout(nrf_timeval)

Timeout value for socket send operation.

Minimum supported resolution is 1 millisecond.

§

BindToPdn(i32)

Bind this socket to a specific PDN ID.

§

ExceptionalData(i32)

Send data on socket as part of exceptional event.

Requires network support and PDN configuration with AT%EXCEPTIONALDATA.

§

KeepOpen(i32)

Keep the socket open when its PDN connection is lost, or the device is set to flight mode.

§

Rai(i32)

Release Assistance Indication (RAI).

Values: NRF_RAI_NO_DATA, NRF_RAI_LAST, NRF_RAI_ONE_RESP, NRF_RAI_ONGOING, NRF_RAI_WAIT_MORE

§

SilenceAll(i32)

Non-zero disables ICMP echo replies on both IPv4 and IPv6.

§

IpEchoReply(i32)

Non-zero enables ICMP echo replies on IPv4.

§

Ipv6EchoReply(i32)

Non-zero enables ICMP echo replies on IPv6.

§

Ipv6DelayedAddrRefresh(i32)

Non-zero delays IPv6 address refresh during power saving mode.

§

TcpServerSessionTimeout(i32)

Configure TCP server session inactivity timeout (0-135 seconds).

§

TlsHostName(&'a str)

Set the hostname used for peer verification.

§

TlsPeerVerify(i32)

Set the peer verification level.

Values: 0 (disabled), 1 (optional), 2 (required)

§

TlsSessionCache(i32)

Non-zero enables TLS session caching.

§

TlsTagList(&'a [nrf_sec_tag_t])

Set/get the security tag associated with a socket.

§

TlsCipherSuiteList(&'a [i32])

Set/get allowed cipher suite list.

§

TlsRole(i32)

Set the role for the connection (client or server).

Values: 0 (client), 1 (server)

§

TlsSessionCachePurge(i32)

Delete TLS session cache (write-only).

§

DtlsHandshakeTimeout(i32)

Set the DTLS handshake timeout.

Values: 0 (no timeout), or specific timeout values

§

DtlsCid(i32)

Set DTLS Connection ID setting.

Values: 0 (disabled), 1 (supported), 2 (enabled)

§

DtlsConnSave(i32)

Save DTLS connection (write-only).

§

DtlsConnLoad(i32)

Load DTLS connection (write-only).

Trait Implementations§

Source§

impl<'a> Debug for SocketOption<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SocketOption<'a>

§

impl<'a> RefUnwindSafe for SocketOption<'a>

§

impl<'a> Send for SocketOption<'a>

§

impl<'a> Sync for SocketOption<'a>

§

impl<'a> Unpin for SocketOption<'a>

§

impl<'a> UnwindSafe for SocketOption<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.