aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Add transport selector interface to Kestrel sockets and QUIC transports

Open JamesNK opened this issue 1 year ago • 2 comments

Follow up PR to address comment https://github.com/dotnet/aspnetcore/pull/44657#discussion_r1010869733

Note: An edge case with SocketTransportFactory is it allows the factory method to be customized with SocketTransportOptions.CreateBoundListenSocket.

A custom method creating the socket means potentially any endpoint could work. Inside user code, a custom EndPoint implementation could be changed to an endpoint type supported by sockets. Limiting the endpoints that can be used to only built-in types would be a breaking change because the custom endpoint type would no longer work.

Does anyone do this? Probably not. If someone is using a custom endpoint type to pass in custom values to the factory method, a workaround to this change is to inherit from one of the supported endpoint types, e.g. IPEndPoint, and add new members..

Is it worth calling out this change? I can create a breaking change issue for this situation after .NET 7 ships.

JamesNK avatar Nov 02 '22 02:11 JamesNK

@Tratcher @halter73 Any more feedback on this PR? I'd like to merge it 🙏

JamesNK avatar Nov 11 '22 04:11 JamesNK

The changed test error in this PR shows it works.

JamesNK avatar Nov 23 '22 23:11 JamesNK