Skip to content

Commit 96370ba

Browse files
authored
net: add TcpSocket::take_error (#4364)
1 parent a9d9bde commit 96370ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tokio/src/net/tcp/socket.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ impl TcpSocket {
409409
.map(|addr| addr.as_socket().unwrap())
410410
}
411411

412+
/// Returns the value of the `SO_ERROR` option.
413+
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
414+
self.inner.take_error()
415+
}
416+
412417
/// Binds the socket to the given address.
413418
///
414419
/// This calls the `bind(2)` operating-system function. Behavior is

0 commit comments

Comments
 (0)