#[non_exhaustive]pub struct SocketError {
pub errno: i32,
pub origin: ErrorOrigin,
pub icmp_type: u8,
pub icmp_code: u8,
pub info: u32,
pub offender: Option<IpAddr>,
pub destination: Option<SocketAddr>,
}Expand description
An error the network or the local stack reported for a datagram this
socket sent, from Timestamped::socket_errors or
sockets::socket_errors. Linux only.
With error reporting on, the kernel also hands the error to the next
send or receive on the socket, which fails once with it, connected or
not; reading the error queue first takes it out of the way. A socket
with errors queued polls as readable (POLLERR, mio’s
is_error()), so drain them on every readable event.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.errno: i32The error number: ECONNREFUSED for a port unreachable,
EHOSTUNREACH, EMSGSIZE for fragmentation needed, ENOBUFS.
origin: ErrorOriginWho reported it.
icmp_type: u8The ICMP or ICMPv6 type, for an ICMP error.
icmp_code: u8The ICMP or ICMPv6 code, for an ICMP error.
info: u32Extra information: the next-hop MTU for fragmentation needed
(EMSGSIZE).
offender: Option<IpAddr>The host that sent the ICMP error, often a router on the way.
destination: Option<SocketAddr>Where the datagram the error is about was going.