Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tokio/src/net/tcp/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ impl TcpSocket {
self.inner.local_addr().and_then(convert_address)
}

/// 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
Expand Down
5 changes: 5 additions & 0 deletions tokio/src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ impl TcpStream {
self.io.local_addr()
}

/// Returns the value of the `SO_ERROR` option.
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
self.io.take_error()
}

/// Returns the remote address that this stream is connected to.
///
/// # Examples
Expand Down