Skip to content

Conversation

@mgravell
Copy link
Collaborator

@mgravell mgravell commented Nov 24, 2020

  • marked by a leading ! in the configuration string, i.e. !/foo connects to /foo over a unix domain socket
  • only available on .builds for NET Core 3.1 and above; in theory we could also support .NET Standard 2.1, but I kinda don't want to add that as a TFM

(the actual work to connect via unix domain sockets has worked for a long time - Socket deals with it)

@mgravell mgravell requested a review from NickCraver November 24, 2020 08:27
Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM functionally, but suggested some quick tweaks to make cleanup super easy in a follow-up as .NET ships some upcoming bits.

<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<DefineConstants Condition="'$(TargetFramework)' != 'net461'">$(DefineConstants);VECTOR_SAFE</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' != 'net461' and '$(TargetFramework)' != 'net472' and '$(TargetFramework)' != 'netstandard2.0'">$(DefineConstants);UNIX_SOCKET</DefineConstants>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend we define NETCOREAPP3_1_OR_GREATER here, which is landing in a future .NET 5.0 SDK (servicing release) we can remove: https://github.com/dotnet/designs/pull/164/files. This let's us cleanup nicely later.

case IPEndPoint ip:
if (ip.Port == 0) return ip.Address.ToString();
return ip.Address + ":" + Format.ToString(ip.Port);
#if UNIX_SOCKET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest:

Suggested change
#if UNIX_SOCKET
#if NETCOREAPP3_1_OR_GREATER

{
if (addressWithPort.Length == 1) return null;

#if UNIX_SOCKET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if UNIX_SOCKET
#if NETCOREAPP3_1_OR_GREATER

@mgravell mgravell merged commit 1920f5a into main Jan 15, 2021
@NickCraver NickCraver deleted the unix-sockets branch March 7, 2022 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants