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

fix(edge): UnixDomainSocketEndPoint is available in .NET 2.1 and greater #1816

Merged
merged 5 commits into from
Mar 9, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage

private async Task<Socket> GetConnectedSocketAsync()
{
var endpoint = new UnixDomainSocketEndPoint(_providerUri.LocalPath);
Socket socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
#if NET451 || NET472 || NETSTANDARD2_0
var endpoint = new UnixDomainSocketEndPoint(_providerUri.LocalPath);
jamdavi marked this conversation as resolved.
Show resolved Hide resolved
await socket.ConnectAsync(endpoint).ConfigureAwait(false);
jamdavi marked this conversation as resolved.
Show resolved Hide resolved
#else
var endpoint = new System.Net.Sockets.UnixDomainSocketEndPoint(_providerUri.LocalPath);
jamdavi marked this conversation as resolved.
Show resolved Hide resolved
await socket.ConnectAsync(endpoint).ConfigureAwait(false);
jamdavi marked this conversation as resolved.
Show resolved Hide resolved
#endif

return socket;
}
Expand Down