Skip to content
Draft
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
15 changes: 14 additions & 1 deletion src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,20 @@ impl Socket {
self.set_nonblocking(false)?;

match res {
Ok(()) => return Ok(()),
Ok(()) => {
// On Apple platforms (macOS, iOS, tvOS, watchOS, visionOS) a
// non-blocking `connect(2)` may return success even though the
// connection is not yet established, so we always fall through
// to `poll_connect` to wait for the connection to complete.
#[cfg(not(any(
target_os = "ios",
target_os = "visionos",
target_os = "macos",
target_os = "tvos",
target_os = "watchos",
)))]
return Ok(());
}
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {}
#[cfg(any(unix, all(target_os = "wasi", not(target_env = "p1"))))]
Err(ref e) if e.raw_os_error() == Some(libc::EINPROGRESS) => {}
Expand Down
Loading