net: add TcpSocket::take_error (#4364)

This commit is contained in:
Taiki Endo
2021-12-31 11:25:50 +01:00
committed by GitHub
parent a9d9bde068
commit 96370ba4ce
+5
View File
@@ -409,6 +409,11 @@ impl TcpSocket {
.map(|addr| addr.as_socket().unwrap())
}
/// Returns the value of the `SO_ERROR` option.
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
self.inner.take_error()
}
/// Binds the socket to the given address.
///
/// This calls the `bind(2)` operating-system function. Behavior is