CXuesong / JsonRpc.Standard

An asynchronous .NET Standard library for JSON RPC client & server implementation.
Apache License 2.0
33 stars 16 forks source link

Support Unix Domain Socket #4

Open DrSensor opened 6 years ago

DrSensor commented 6 years ago

Is this library support Unix Domain Socket? https://blogs.msdn.microsoft.com/commandline/2018/02/07/windowswsl-interop-with-af_unix/

There is a possibility that in the future language server protocol can use/prefer Unix Socket because Win 10 now support that.

CXuesong commented 6 years ago

Not yet. But I will look into this when I'm available!

CXuesong commented 6 years ago

Though it seems that the NamedPipe*Stream on Linux is actually implemented with Unix domain sockets (See dotnet/corefx#6833), from dotnet/corefx#27631, I assume there will be something like UnixDomainSocketEndPoint in .NET Core 2.1, and this is what you are talking about.

Well, then, first of all I need to install VS 15.7 Preview 1 to try out this new socket endpoint .NET Core 2.1 🌚 This may take a moment.

CXuesong commented 6 years ago

Okay so now I've played with sockets for a while (and for the first time in my life 😂). See CXuesong/UnixDomainSocketTest.

It seems that you can wrap the underlying sockets with NetworkStream (See my test code here). If this is the case, then basically you can use CXuesong.JsonRpc.Streams to work on the stream layer.

I will revisit this issue to see if I can actually work out a demo LSP on Unix sockets when I'm available next time. Until then, feel free to try this out on yourself!

CXuesong commented 6 years ago

Blocker reached: There is currently no Unix Domain Socket support in nodejs on Windows… Oops.