Skip to content

fix socket channel set exit events#40924

Open
chemwolf6922 wants to merge 1 commit into
masterfrom
user/chemwolf6922/fix-socket-channel-set-exit-events
Open

fix socket channel set exit events#40924
chemwolf6922 wants to merge 1 commit into
masterfrom
user/chemwolf6922/fix-socket-channel-set-exit-events

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Set the exit events as specified instead of ignoring them.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@chemwolf6922 chemwolf6922 requested a review from a team as a code owner June 26, 2026 08:05
Copilot AI review requested due to automatic review settings June 26, 2026 08:05

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 fixes SocketChannel exit-event handling on Windows by actually applying the caller-specified exit events instead of effectively discarding them, so socket operations can be canceled/aborted on the intended shutdown signals.

Changes:

  • Fix SocketChannel::SetExitEvents to update m_exitEvents with the provided events.
  • Return the previous exit-event list from SetExitEvents after updating the member.

Comment on lines 134 to +137
std::vector<HANDLE> SetExitEvents(std::vector<HANDLE>&& exitEvents)
{
std::vector<HANDLE> oldEvents;
std::swap(oldEvents, m_exitEvents);
return oldEvents;
std::swap(exitEvents, m_exitEvents);
return std::move(exitEvents);

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.

I think I agree with this.

@OneBlue OneBlue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great catch, thank you !

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.

4 participants