net: add TcpSocket::take_error (#4364)

This commit is contained in:
Taiki Endo 2021-12-31 19:25:50 +09:00 committed by GitHub
parent a9d9bde068
commit 96370ba4ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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