diff --git a/tokio/src/net/tcp/socket.rs b/tokio/src/net/tcp/socket.rs index fc240e052..84c255b9b 100644 --- a/tokio/src/net/tcp/socket.rs +++ b/tokio/src/net/tcp/socket.rs @@ -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> { + self.inner.take_error() + } + /// Binds the socket to the given address. /// /// This calls the `bind(2)` operating-system function. Behavior is