| ... | @@ -11025,7 +11025,11 @@ fn openSocketWsa( | ... | @@ -11025,7 +11025,11 @@ fn openSocketWsa( |
| 11025 | ) !ws2_32.SOCKET { | 11025 | ) !ws2_32.SOCKET { |
| 11026 | const mode = posixSocketMode(options.mode); | 11026 | const mode = posixSocketMode(options.mode); |
| 11027 | const protocol = posixProtocol(options.protocol); | 11027 | const protocol = posixProtocol(options.protocol); |
| 11028 | const flags: u32 = ws2_32.WSA_FLAG_NO_HANDLE_INHERIT; | 11028 | // WSA_FLAG_OVERLAPPED is chosen here because without this different |
| | 11029 | // threads cannot use the same open socket handle. |
| | 11030 | // TODO: the below code needs to use the AlertableSyscall mechanism instead in |
| | 11031 | // order to make cancelation work. |
| | 11032 | const flags: u32 = ws2_32.WSA_FLAG_OVERLAPPED | ws2_32.WSA_FLAG_NO_HANDLE_INHERIT; |
| 11029 | var syscall: Syscall = try .start(); | 11033 | var syscall: Syscall = try .start(); |
| 11030 | while (true) { | 11034 | while (true) { |
| 11031 | const rc = ws2_32.WSASocketW(family, @bitCast(mode), @bitCast(protocol), null, 0, flags); | 11035 | const rc = ws2_32.WSASocketW(family, @bitCast(mode), @bitCast(protocol), null, 0, flags); |