Skip to content

Commit

Permalink
Fixing path for multiple os
Browse files Browse the repository at this point in the history
  • Loading branch information
birojnayak committed Jul 21, 2023
1 parent 4c9572f commit ab7da84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private async Task<IConnection> CreateConnectionAsync(Uri uriPath)
{
AddressFamily addressFamily = AddressFamily.Unix;
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.IP);
var endpoint = new UnixDomainSocketEndPoint(uriPath.AbsolutePath);
var endpoint = new UnixDomainSocketEndPoint(uriPath.LocalPath);
await socket.ConnectAsync(endpoint);
return new SocketConnection(socket, _bufferSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;

namespace System.ServiceModel.Channels
Expand Down Expand Up @@ -35,6 +36,25 @@ protected override string GetConnectionPoolKey(EndpointAddress address, Uri via)
return via.AbsolutePath;
}

protected override TChannel OnCreateChannel(EndpointAddress address, Uri via)
{
if(address.Identity == null)
{
var hostIdentity = new DnsEndpointIdentity(address.Uri.Host ?? "localhost");
var uriBuilder = new UriBuilder(address.Uri);
uriBuilder.Host = null;
address = new EndpointAddress(uriBuilder.Uri, hostIdentity,address.Headers.ToArray());
}

if(via !=null)
{
var uriBuilder = new UriBuilder(via);
uriBuilder.Host = null;
via = uriBuilder.Uri;
}

return base.OnCreateChannel(address,via);
}
public override T GetProperty<T>()
{
if (typeof(T) == typeof(IConnectionPoolSettings))
Expand Down

0 comments on commit ab7da84

Please sign in to comment.