-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Enable custom socket end points and allow Unix Domain Sockets #5051
Conversation
|
Hi @IlyaBiryukov, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! TTYL, DNFBOT; |
|
I've just associated my GitHub account with Microsoft before creating this pull request, I guess the DNFBOT doesn't know that yet and added cla-required tag. |
|
Even if you associate your GitHub account with your Microsoft account, you still need to sign the CLA. |
|
cc: @AArnott |
Commit signed off by @ilyab which is not associated with Microsoft 😄 |
fd3ac8e to
db4f3a1
Compare
|
Fixed the commit author. |
|
@IlyaBiryukov, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What version of OS X are you running? On 10.9, the max path length is 104: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man4/unix.4.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
108 is on Linux. OSX has 104. So we should make it 104 I guess..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs say that it may even be as less as 92, for example here, http://man7.org/linux/man-pages/man7/unix.7.html. I'll change it to 92.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. FWIW, the Open Group Base Specification is generally a good source of truth for these things, and it agrees with 92 as a lower bound.
|
LGTM |
c171b18 to
0b82483
Compare
|
If there are no more comments, how can this pull request be committed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this work for a DnsEndPoint? Please add a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already existing tests for DnsEndpoint. The code checks if it's DNS end point before it calls IPEndPointExtensions.
0b82483 to
0cf9382
Compare
|
I addressed all the comments. Is there anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we might want this to be in a finally block to ensure that we run cleanup even if the test fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
|
LGTM aside from one nit. Thanks for doing this! |
With code separation into System.Net.Primitives and System.Net.Sockets, EndPoint extensibility was broken because System.Net.Sockets started to use its own copy of SocketAddress and didn't respect SocketAddress that a custom EndPoint may provide. The fix is to allow conversion between SocketAddress from System.Net.Primitives and System.Net.Sockets. This way custom implementations of EndPoint will be able to provide their own SocketAddress and it'll be honored by the Socket APIs. The fix also allows sockets to use 'Unspecified' protocol type which is needed for Unix Domain Sockets. There are several changes in socket test server to allow tests pass protocol type. Add new unit tests that use end point extensibility to implement Unix Domain Sockets. Fix #4777
0cf9382 to
0d07c5c
Compare
Enable custom socket end points and allow Unix Domain Sockets
With code separation into System.Net.Primitives and System.Net.Sockets,
EndPoint extensibility was broken because System.Net.Sockets started to
use its own copy of SocketAddress and didn't respect SocketAddress that
a custom EndPoint may provide.
The fix is to allow conversion between SocketAddress from System.Net.Primitives
and System.Net.Sockets. This way custom implementations of EndPoint will
be able to provide their own SocketAddress and it'll be honored by the
Socket APIs.
The fix also allows sockets to use 'Unspecified' protocol type which is
needed for Unix Domain Sockets. There are several changes in socket test
server to allow tests pass protocol type.
Add new unit tests that use end point extensibility to implement Unix
Domain Sockets.
Fix #4777