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
9
votes
2 answers

Named Pipes - Asynchronous Peeking

I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in asynchronous mode has more data available for reading on it- a WaitHandle would be ideal. I cannot simply use BeginRead() to obtain such a handle because it's…
KJ Tsanaktsidis
  • 1,255
  • 1
  • 17
  • 28
9
votes
3 answers

Read/Write to linux Pipe using Java

My query is on what is the best way to read / write to a linux Pipe in Java? I already am using the java.io.RandomAccessFile like RandomAccessFile file = new RandomAccessFile("/dev/zap/16", "rw"); and then passing it to worker thread which reads…
amit.bhayani
  • 508
  • 2
  • 5
  • 7
9
votes
1 answer

WriteFileEx completion routine succeeds, but bytes transferred is incorrect

I'm communicating between two processes on different machines via a pipe, using IO completion routines. Occasionally, when the completion routine for WriteFileEx gets called, the completion routine parameter dwErrorCode is 0 (i.e. no error),…
parrowdice
  • 1,902
  • 15
  • 24
9
votes
2 answers

Two way C++ to C# communication using named pipes

I am trying to have a 2-way communication between a VC++ 6 app and a C# app. I am using named pipes. In my C++ code I can read the message from the C# client but then the server "dies" and I have to restart it again. What I want to do is have the…
Bob Moore
  • 173
  • 1
  • 1
  • 5
8
votes
3 answers

What is an overlapped I/O alternative to WaitNamedPipe?

The WaitNamedPipe function allows a pipe client application to synchronously wait for an available connection on a named pipe server. You then call CreateFile to open the pipe as a client. Pseudocode: // loop works around race condition with…
James Johnston
  • 9,264
  • 9
  • 48
  • 76
8
votes
1 answer

Read/write example codes for TPipeServer and TPipeClient components and security check

I need IPC between a windows service and a GUI application both written in Delphi 2010. I decided to use named pipe for this. I built and installed successfully Russell Libby's TPipeServer and TPipeClient components (link). I followed other answers…
8
votes
3 answers

Communication between windows service and desktop app

I want to create a communication between a windows service and a desktop application on Windows 7. I read that named pipes are one way for communication between two processes. Can i use them for my purpose?
petko_stankoski
  • 10,459
  • 41
  • 127
  • 231
8
votes
2 answers

Making a Perl daemon that runs 24/7 and reads from named pipes

I'm trying to make a log analyser using perl. The analyser would run 24/7 in the background on an AIX server and read from pipes that syslog directs logs to (from the entire network). Basically: logs from network ----> named pipe A --------> |…
user623990
8
votes
2 answers

Named Pipe closing prematurely in script?

ls: prwx------ 1 root root 0 fifo write.sh: #! /bin/bash while true; do echo "blah" > fifo done read.sh: #! /bin/bash while true; do cat fifo done I have two terminals open, one running write.sh and another running read.sh. When I start…
user623990
8
votes
1 answer

Are there repercussions to having many processes write to a single reader on a named pipe in posix?

I am writing a program for POSIX (OSX) where I will have many processes sending messages to one listener, who is essentially a logging thread. All of the processes are running in seperate programs, and using a single named pipe (FIFO) that many…
Aftermathew
  • 1,958
  • 2
  • 13
  • 21
8
votes
1 answer

How to stop a thread which is blocking on a named pipe in Python?

I have a class which subclasses threading.Thread. It's sole responsibility is putting messages read from a UNIX named pipe to a queue.Queue object (so that other threads can process these values later). Example code: class PipeReaderThread(Thread): …
krispet krispet
  • 1,648
  • 1
  • 14
  • 25
8
votes
0 answers

Named Pipes no longer a thing in Windows 10 version 1709?

I was trying to work with Named Pipe as a communication channel between injected stubs in various processes. I was reading and it states Process Isolation Sandboxing the application kernel objects, the AppContainer environment prevents the…
user8698205
8
votes
2 answers

Connecting via named pipe from windows service (session#0) to desktop app (session #1)

Given: - the application - desktop GUI (WPF) .NET app - windows service watching for application (.NET also) The windows service periodically "pings" application to get sure it's healthy (and if it's not winservice will restart it). I was going…
Shrike
  • 9,218
  • 7
  • 68
  • 105
8
votes
2 answers

Is it possible to discover named pipes in Windows?

Is there any method or tool that list existing named pipes in a Windows box?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
8
votes
1 answer

How do you send a named pipe string from umnanaged to managed code space?

I appear to have a named pipes 101 issue. I have a very simple set up to connect a simplex named pipe transmitting from a C++ unmanaged app to a C# managed app. The pipe connects, but I cannot send a "message" through the pipe unless I close the…
user320240
  • 133
  • 2
  • 5