Skip to content

fix(driver,iocp): report Winsock error codes for socket operations - #1

Closed
lexoliu wants to merge 4 commits into
masterfrom
fix/iocp-socket-winsock-errors
Closed

lexoliu wants to merge 4 commits into
masterfrom
fix/iocp-socket-winsock-errors

Conversation

@lexoliu

@lexoliu lexoliu commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Fixes #

Socket operations on the IOCP driver now report Winsock error codes. OpCode gains completion_error, a no-op by default, which the driver calls on a failed completion. The socket ops (and the managed ops wrapping them) override it to ask WSAGetOverlappedResult for the provider's error. Cancellation keeps ERROR_OPERATION_ABORTED, so cancel detection is unchanged.

With that, a refused connect is ConnectionRefused, and an ICMP port unreachable on UDP is WSAECONNRESET. compio-quic no longer needs its ERROR_PORT_UNREACHABLE arm.

Adds connect_refused to compio-net/tests/tcp_connect.rs.

dependabot Bot and others added 4 commits November 11, 2026 16:14
Bumps [rust-toolchain](https://github.com/rust-lang/rust) from nightly-2026-11-03 to nightly-2026-11-10.
- [Release notes](https://github.com/rust-lang/rust/releases)
- [Changelog](https://github.com/rust-lang/rust/blob/main/RELEASES.md)
- [Commits](https://github.com/rust-lang/rust/commits)

---
updated-dependencies:
- dependency-name: rust-toolchain
  dependency-version: nightly-2026-11-10
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rust-overlay](https://github.com/oxalica/rust-overlay) from `6ecf534` to `d3fe742`.
- [Commits](oxalica/rust-overlay@6ecf534...d3fe742)

---
updated-dependencies:
- dependency-name: rust-overlay
  dependency-version: d3fe74269f2a6652437e21e78eb7e83be81f6982
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
A failed completion carries an NTSTATUS, which the driver converts to a
Win32 code. For a socket that is not what a Winsock call reports: a
refused connect comes back as ERROR_CONNECTION_REFUSED (1225) instead of
WSAECONNREFUSED, and io::Error::kind() calls it Uncategorized. Socket
operations now resolve the error through WSAGetOverlappedResult, so a
refused connect is ConnectionRefused and an ICMP port-unreachable on a UDP
socket is ConnectionReset, as with mio.
@lexoliu

lexoliu commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

Opened upstream as compio-rs#1146.

@lexoliu lexoliu closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants