Uh oh!
There was an error while loading. Please reload this page.
Socket.Windows: support ConnectAsync(SocketAsyncEventArgs) for UDP, and Unix sockets - #33674
Conversation
davidsh
commented
Mar 17, 2020
We'll want to run Outerloop tests before this can be merged. |
Uh oh!
There was an error while loading. Please reload this page.
scalablecory
left a comment
There was a problem hiding this comment.
small question/nit, otherwise looks good.
Looks like there's no need to check @tmdswith this change all tests are passing. It also includes an additional test for all connect variants to improve coverage. |
antonfirsov
commented
Mar 21, 2020
/azp run runtime-libraries outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
I'm guilty of not testing my proposal locally on Linux, and it looks like we have a bunch of related test failures, mostly specific to connect with IPv6 . I guess we are still missing something about that obscure |
| { | ||
| try | ||
| { | ||
| if (_currentSocket!.SocketType != SocketType.Stream) |
There was a problem hiding this comment.
@antonfirsov@scalablecory also give this condition some thought. Personally, I'm fine if CI passes. You may have a better understanding of what SO_UPDATE_CONNECT_CONTEXT does to decide if this is the most appropriate check.
There was a problem hiding this comment.
This should match the logic for CanUseConnectEx. We need to call SO_UPDATE_CONNECT_CONTEXT if ConnectEx is used.
There was a problem hiding this comment.
I was thinking the same thing, though it seems the stream unix socket, which doesn't support ConnectEx, doesn't give an error when we set this socket option.
We added the check because UDP socket gave an error.
tmds
commented
Mar 21, 2020
@antonfirsov , you can push commits to this branch. |
tmds
commented
Mar 31, 2020
@antonfirsov I noticed the failures are not Windows-only, I will investigate further. |
antonfirsov
commented
Mar 31, 2020
@tmds yes, they are mostly specific to Linux and IPv6 as far as I remember. |
tmds
commented
Apr 2, 2020
@scalablecory@antonfirsov |
scalablecory
commented
Apr 2, 2020
Thank you! Will take a look shortly. |
antonfirsov
commented
Apr 2, 2020
/azp run runtime-libraries outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| return (_socketType == SocketType.Stream) && | ||
| (_rightEndPoint != null || remoteEP.GetType() == typeof(IPEndPoint)) && | ||
| (remoteEP.AddressFamily != AddressFamily.Unix); |
There was a problem hiding this comment.
I wonder if @stephentoub's #33674 (comment) also applies to AddressFamily ? Wouldn't it be more future proof to use the condition (remoteEP.AddressFamily == AddressFamily.InterNetwork || remoteEP.AddressFamily == AddressFamily.InterNetworkV6) instead?
There was a problem hiding this comment.
I have no preference for remoteEP.GetType() == typeof(IPEndPoint) vs (remoteEP.AddressFamily == AddressFamily.InterNetwork || remoteEP.AddressFamily == AddressFamily.InterNetworkV6), so I kept the check as it was.
antonfirsov
left a comment
There was a problem hiding this comment.
LGTM, and all test failures are unrelated. If someone else can confirm, I think we are safe to merge.
These are the changes from #787 that deal with making
ConnectAsync(SocketAsyncEventArgs)work for non-stream protocols (like UDP) on Windows.cc @stephentoub@antonfirsov @dotnet/ncl