Skip to content

feat(net,win)!: make socket & shutdown sync - #789

Merged
George-Miao merged 1 commit into
compio-rs:masterfrom
Berrysoft:dev/iocp-socket-sync
Mar 25, 2026
Merged

George-Miao merged 1 commit into
compio-rs:masterfrom
Berrysoft:dev/iocp-socket-sync

Conversation

@Berrysoft

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Windows networking path to avoid offloading socket() creation and shutdown() onto blocking tasks, aligning those operations with their inherently synchronous OS behavior while keeping Unix behavior driver-submitted.

Changes:

  • Windows: Socket::new and Socket::accept no longer use spawn_blocking for Socket2::new.
  • Windows: Socket::shutdown now calls socket2::Socket::shutdown directly instead of submitting a driver op.
  • Driver: moves ShutdownSocket into Unix-only ops and removes the IOCP ShutdownSocket implementation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
compio-net/src/socket.rs Removes Windows spawn_blocking usage for socket creation/accept socket creation; makes Windows shutdown direct/synchronous; keeps Unix shutdown as an op.
compio-driver/src/sys/unix_op.rs Introduces Unix ShutdownSocket op type in the Unix op definitions.
compio-driver/src/sys/iocp/op.rs Removes the IOCP ShutdownSocket OpCode implementation and related WinSock constants/imports.
compio-driver/src/op.rs Removes cross-platform ShutdownSocket type definition and re-exports it only on Unix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-net/src/socket.rs Resolved
Comment thread compio-net/src/socket.rs Resolved
Comment thread compio-driver/src/op.rs Resolved
@Berrysoft Berrysoft changed the title feat(net,win): make socket & shutdown sync feat(net,win)!: make socket & shutdown sync Mar 24, 2026
@Berrysoft
Berrysoft requested a review from George-Miao March 24, 2026 11:04
@George-Miao George-Miao added enhancement New feature or request driver: iocp About the IOCP driver package: net Related to compio-net breaking change labels Mar 25, 2026

@George-Miao George-Miao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@George-Miao
George-Miao merged commit 3ee37ca into compio-rs:master Mar 25, 2026
71 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 25, 2026
@Berrysoft
Berrysoft deleted the dev/iocp-socket-sync branch March 25, 2026 02:50
This was referenced Apr 21, 2026
@github-actions github-actions Bot mentioned this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change driver: iocp About the IOCP driver enhancement New feature or request package: net Related to compio-net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants