Skip to content

IpcClient.CreateUnixDomainSocketEndPoint implementation for Mono #821

Closed

Description

@k15tfu

Hi!

It turns out that Mono defines System.Net.Sockets.UnixDomainSocketEndPoint in System.Core. Therefore to get this code to work

private static EndPoint CreateUnixDomainSocketEndPoint(string path)
{
#if NETCOREAPP
return new UnixDomainSocketEndPoint(path);
#elif NETSTANDARD2_0
// UnixDomainSocketEndPoint is not part of .NET Standard 2.0
var type = typeof(Socket).Assembly.GetType("System.Net.Sockets.UnixDomainSocketEndPoint");
if (type == null)
{
throw new PlatformNotSupportedException("Current process is not running a compatible .NET Core runtime.");
}
var ctor = type.GetConstructor(new[] { typeof(string) });
return (EndPoint)ctor.Invoke(new object[] { path });
#endif
}

we should do everything the same but

var type = Assembly.Load("System.Core").GetType("System.Net.Sockets.UnixDomainSocketEndPoint");

Would you mind adding this case to IpcClient.CreateUnixDomainSocketEndPoint? I can prepare a PR.

Activity

  1. davidfowl commented on Feb 11, 2020

    @davidfowl
    Member

    Does mono support the event pipe?

  2. josalem commented on Feb 11, 2020

    @josalem
    Contributor

    Mono does not have EventPipe, but you could write a client app that runs on the mono runtime.

    CC @sywhang

  3. self-assigned this
    on Feb 11, 2020
  4. added this to the 5.0 milestone on Feb 11, 2020
  5. sywhang commented on Feb 11, 2020

    @sywhang
    Contributor

    Would you mind adding this case to IpcClient.CreateUnixDomainSocketEndPoint? I can prepare a PR.

    @k15tfu Yup, that sounds fine to me. Please feel free to submit a PR and add me to the review :)

  6. k15tfu commented on Feb 12, 2020

    @k15tfu
    ContributorAuthor

    @sywhang Great.

  7. added 2 commits that reference this issue on Feb 12, 2020
    dc180b2
    32e66a6
  8. added a commit that references this issue on Apr 7, 2020
    7e0f7a5
  9. ghost locked as resolved and limited conversation to collaborators on Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions