Questions tagged [named-pipes]

A named pipe is an inter-process communication mechanism, which exists both on Unix and Unix-like systems (where it is also known as a FIFO and is file-like), and on Microsoft Windows (where it is an in-memory kernel object). The semantics and APIs differ substantially between the platforms.

Unix

On Unix and Unix-like systems a named pipe (also known as a FIFO for its behavior) is an extension to the traditional pipe concept, and is one of the methods of inter-process communication.

A traditional pipe is "unnamed" because it exists anonymously and persists only for as long as the process is running. A named pipe is system-persistent and exists beyond the life of the process and must be deleted once it is no longer being used. Processes generally attach to the named pipe (usually appearing as a file) to perform inter-process communication (IPC).

Windows

On Windows operating systems a named pipe is a named kernel object which provides duplex data transfers between two processes, a pipe server and a pipe client. Multiple completely independent instances of a particular named pipe object can be created, each connecting the pipe server to exactly one client. A pipe instance persists only as long as its server and client processes keep a handle referencing it.

Communication between the server and client via a pipe instance may be either stream-oriented or message-oriented.

1850 questions
8
votes
1 answer

ConnectNamedPipe and asio overlappped ptr

I've named pipe server which is written using boost asio. Server creates named pipe and calls ConnectNamedPipe passing asio overlapped ptr to it. The problem is that completion handler passed to asio overlapped is never called, that is calling…
iendgame
  • 153
  • 7
8
votes
2 answers

Cancel NamedPipeClientStream.Read call

I've looked around all over the web, but I can't find an answer to the following question. I have a C#/.NET NamedPipeClientStream instance in a client program, and a worker thread is calling NamedPipeClientStream.Read(byte[], int, int) to get data…
Chris
  • 213
  • 6
  • 11
8
votes
1 answer

Prevent Named Pipes Conflict

We have a .NET program that uses WCF to listen for communication from another process. We used named pipes. ServiceHost host = new ServiceHost( typeof(Something), new Uri[] { new Uri("net.pipe://localhost") …
user256808
8
votes
3 answers

Performance of sockets vs pipes

I have a Java-program which communicates with a C++ program using a socket on localhost. Can I expect to gain any performance (either latency, bandwidth, or both) by moving to use a native OS pipe? I'm primarily interested in Windows at the moment,…
JesperE
  • 63,317
  • 21
  • 138
  • 197
8
votes
1 answer

C# all pipe instances are busy

The following code creates a new thread acting first as a named pipe client for sending parameters and then as a server for retrieving results. After that it executes a function in another AppDomain acting as a named pipe server and after that as a…
Serve Laurijssen
  • 9,266
  • 5
  • 45
  • 98
8
votes
3 answers

Named Pipes between C# and Python

I'm trying to create a two-way communication channel between two programs (one in Python and another in C#) When I create a named pipe between two C# programs or two Python programs, everything is OK, but when I try to (for example) connect to the…
Mehdi Asgari
  • 2,111
  • 3
  • 17
  • 18
8
votes
1 answer

duplex operation between two processes using named pipes in c#

I am trying to use named pipes to communicate between a server and a client process on the same machine. server sends a message to client, client does something with it and returns a result, and server is supposed to get the result. here is the code…
jambodev
  • 351
  • 2
  • 3
  • 9
8
votes
2 answers

Write to fifo (named pipe)

I'm trying to get a fortran 90 application to open a fifo and write formatted data to it. I've stripped this down to a minimal example. Let foo.f90 be the following program: program foo open(1,file='fifo',position='asis',action='write') …
MvG
  • 57,380
  • 22
  • 148
  • 276
7
votes
2 answers

How do I block on reading a named pipe in Ruby?

I'm trying to set up a Ruby script that reads from a named pipe in a loop, blocking until input is available in the pipe. I have a process that periodically puts debugging events into a named pipe: # Open the logging pipe log = File.open("log_pipe",…
WaveformDelta
  • 141
  • 1
  • 8
7
votes
2 answers

WINE and Windows named pipes

Here is my problem: I have a closed-source third-party Win32 application, which acts as a server for other programs via named pipes, i.e. it expects its clients to do smth like this: HANDLE h = CreateFile("\\\\.\\pipe\\$pipe_name$", GENERIC_READ |…
ScumCoder
  • 690
  • 1
  • 8
  • 20
7
votes
2 answers

Can you read and write with a single Named Pipe client?

I've written a little apllication that creates a named pipe server and a client that connects to it. You can send data to the server, and the server reads it successfully. The next thing I need to do is receive messages from the server, so I've got…
Iain Ward
  • 9,850
  • 5
  • 34
  • 41
7
votes
2 answers

MySQL named pipes on Windows--faster best practice, or bad idea?

Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows, and connect via the .NET connector driver. It's often recommended for security purposes, but one thing it allows me to do is connect with "." as…
Garen
  • 941
  • 2
  • 9
  • 20
7
votes
5 answers

How do I transparently compress/decompress a file as a program writes to/reads from it?

I have a program that reads and writes very large text files. However, because of the format of these files (they are ASCII representations of what should have been binary data), these files are actually very easily compressed. For example, some…
A. Rex
  • 31,633
  • 21
  • 89
  • 96
7
votes
1 answer

chaining Popen subprocesses properly

i have a construct like the following: os.mkfifo('pipe.tmp') enc = Popen(['encoder', '-i', 'pipe.tmp']) cap = Popen(['capture', '-f', 'pipe.tmp']) here cap is a process which normally writes to a file (specified by -f), but i can get it to spew…
wim
  • 338,267
  • 99
  • 616
  • 750
7
votes
1 answer

Non-blocking named pipes

Issue summary: I've managed to speed up the thumbing of images upon upload dramatically from what it was, at the cost of using concurrency. Now I need to secure that concurrency against a race condition. I was going to have the dependent script…
Grault
  • 974
  • 12
  • 31