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

NamedPipeServerStream creates a socket not a fifo on ubuntu #24390

Closed
huiguochen opened this issue Dec 8, 2017 · 4 comments
Closed

NamedPipeServerStream creates a socket not a fifo on ubuntu #24390

huiguochen opened this issue Dec 8, 2017 · 4 comments
Labels
area-System.IO question Answer questions and provide assistance, not an issue with source code or documentation.
Milestone

Comments

@huiguochen
Copy link

I expected to use NamedPipeServerStream to create a fifo file on linux, but it created a socket Named "CoreFxPipe_1.fifo" in /tmp directory.
here is test code:

            NamedPipeServerStream fifo = new NamedPipeServerStream("1.fifo",PipeDirection.InOut);
            fifo.WaitForConnection();

what is the reason? how to create a fifo on linux?

[EDIT] Add C# syntax highlighint by @karelz

@mikedn
Copy link
Contributor

mikedn commented Dec 8, 2017

@eerhardt
Copy link
Member

eerhardt commented Jan 3, 2018

Thanks @mikedn. #14633 answers this question, and along with the description of the PR that changed from fifo to sockets - dotnet/corefx#6833.

Closing as this is answered.

@eerhardt eerhardt closed this as completed Jan 3, 2018
@DrSensor
Copy link

DrSensor commented Apr 26, 2018

Any workaround or specific param like NamedPipeServerStream("1.fifo", PipeDirection.Out, fifo: true) to use linux named pipe instead of unix socket? It break the compatibility when in use for communicating between 2 different programming language.

FYI: Windows 10 now support unix socket

@eerhardt
Copy link
Member

You can use the Mono.Posix.NetStandard library on .NET Core to get access to the mkfifo POSIX command. This will allow your program to read/write to a FIFO/Unix named pipe.

Regarding Windows 10 now supporting unix domain sockets, .NET Core allows that as well if you are running on a Windows 10 machine that has support for UDS. See dotnet/corefx#27631 for the PR that added support for it.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

5 participants