Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On windows, initialize IO types (for example, sockets) with WSA_FLAG_OVERLAPPED #24206

Closed
carllerche opened this issue Apr 8, 2015 · 0 comments · Fixed by #24211
Closed

On windows, initialize IO types (for example, sockets) with WSA_FLAG_OVERLAPPED #24206

carllerche opened this issue Apr 8, 2015 · 0 comments · Fixed by #24211

Comments

@carllerche
Copy link
Member

As per the docs: https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212%28v=vs.85%29.aspx

Most sockets should be created with this flag set. Overlapped sockets can utilize WSASend, WSASendTo, WSARecv, WSARecvFrom, and WSAIoctl for overlapped I/O operations, which allow multiple operations to be initiated and in progress simultaneously.

If I understand correctly, this flag must be set at initialization time of the socket (and other types), does not have a cost, and enables the socket to be used in overlap mode w/ completion ports.

Doing this will be helpful for when I add windows support to mio.

cc @alexcrichton

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 8, 2015
This commit modifies the socket creation functions on windows to always specify
the `WSA_FLAG_OVERLAPPED` and `WSA_FLAG_NO_HANDLE_INHERIT` flags by default. The
overlapped flag enables IOCP APIs on Windows to be used with the socket at no
cost, enabling better interoperation with external libraries. The no handle
inherit flag mirrors the upcoming change to Unix to set CLOEXEC by default for
all handles.

Closes rust-lang#24206
alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 14, 2015
This commit modifies the socket creation functions on windows to always specify
the `WSA_FLAG_OVERLAPPED` and `WSA_FLAG_NO_HANDLE_INHERIT` flags by default. The
overlapped flag enables IOCP APIs on Windows to be used with the socket at no
cost, enabling better interoperation with external libraries. The no handle
inherit flag mirrors the upcoming change to Unix to set CLOEXEC by default for
all handles.

Closes rust-lang#24206
bors added a commit that referenced this issue Apr 15, 2015
…uron

This commit modifies the socket creation functions on windows to always specify
the `WSA_FLAG_OVERLAPPED` and `WSA_FLAG_NO_HANDLE_INHERIT` flags by default. The
overlapped flag enables IOCP APIs on Windows to be used with the socket at no
cost, enabling better interoperation with external libraries. The no handle
inherit flag mirrors the upcoming change to Unix to set CLOEXEC by default for
all handles.

Closes #24206
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 a pull request may close this issue.

2 participants