named-pipes

which is better POSIX Message Queue or PIPES for producer consumer problem

假如想象 提交于 2020-08-20 11:07:03
问题 I have a producer Thread as well as consumer thread where producer runs faster than consumer i need to transfer data from producer and process it on consumer, producer will give an array of 1000 elements every second and consumer should wait till it has 10 sets of arrays and will process it (consumer runs every 10 seconds) i could see that we can modify POSIX message queue to input an array of 1000 elements double array which is a better method to transfer real data, POXIS message queue or

How to use named pipes in C# correctly — several connections, server recreation etc

最后都变了- 提交于 2020-08-02 06:58:21
问题 I need to implement an inter-process communication between C# applications. I decided to use named pipes and wrote the following code: Server while (true) { using (var server = new NamedPipeServerStream("some_pipe")) { server.WaitForConnection(); using (var reader = new StreamReader(server)) { string line = reader.ReadLine(); MessageBox.Show(line); } } } Client using (var client = new NamedPipeClientStream("some_pipe")) { client.Connect(); using (var writer = new StreamWriter(client)) {

Change Named Pipe Access Permissions

前提是你 提交于 2020-07-09 03:27:17
问题 I have created a named pipe using System.IO.Pipes . It worked fine until I had to run the program in admin mode. When elevated, the client can no longer connect (client is not running elevated). If I run the client as administrator, it connects fine so it looks like a permissions issue. I've been researching how to fix this and have been unsuccessful (I find dealing with Windows security mind boggling). My goal is to allow any client - whether elevated or not - to be able to connect to the

Change Named Pipe Access Permissions

空扰寡人 提交于 2020-07-09 03:26:57
问题 I have created a named pipe using System.IO.Pipes . It worked fine until I had to run the program in admin mode. When elevated, the client can no longer connect (client is not running elevated). If I run the client as administrator, it connects fine so it looks like a permissions issue. I've been researching how to fix this and have been unsuccessful (I find dealing with Windows security mind boggling). My goal is to allow any client - whether elevated or not - to be able to connect to the

Why does the buffering of std::ifstream “break” std::getline when using LLVM?

对着背影说爱祢 提交于 2020-07-06 07:04:23
问题 I have a simple C++ application which is supposed to read lines from a POSIX named pipe: #include<iostream> #include<string> #include<fstream> int main() { std::ifstream pipe; pipe.open("in"); std::string line; while (true) { std::getline(pipe, line); if (pipe.eof()) { break; } std::cout << line << std::endl; } } Steps: I create a named pipe: mkfifo in . I compile & run the C++ code using g++ -std=c++11 test.cpp && ./a.out . I feed data to the in pipe: sleep infinity > in & # keep pipe open,

Bash process substitution behaves differently than named pipe?

房东的猫 提交于 2020-06-16 16:58:47
问题 Kind of a follow up to this question. I use bash process substitution expecting to see 5 lines of output (corresponding to 5s timeout) however I only see 4 lines: timeout 5s dd if=/dev/random | pv -fr > /dev/null 2> >(tr '\r' '\n' >&2) [5.42kiB/s] [1.89kiB/s] [5.36kiB/s] [2.41kiB/s] However if I place a named pipe in the middle I do get the 5 lines as expected. First shell: mkfifo testfifo cat testfifo | tr '\r' '\n' >&2 Second shell: timeout 5s dd if=/dev/random | pv -fr > /dev/null 2>

Is it possible to prevent application from hanging when both stdin and stdout are connected to named pipes?

孤者浪人 提交于 2020-05-13 21:00:32
问题 Consider the following simple C program, which I will compile to a program called "A": #include <stdio.h> int main(int argc, char** argv){ putchar('C'); putchar('\n'); } Now, consider the following bash script: #!/bin/bash mkfifo Output1.pipe mkfifo Output2.pipe stdbuf -i0 -o0 -e0 ./A > Output1.pipe & stdbuf -i0 -o0 -e0 ./A > Output2.pipe & cat Output1.pipe cat Output2.pipe The output of this script is C\nC . So far everything is fine. Now let's consider the following modification the bash

ffmpeg output pipeing to named windows pipe

旧时模样 提交于 2020-04-10 14:50:35
问题 This question is related to my previous question: Converting raw frames into webm live stream I want to pipe a video to ffmpeg and read it back through another pipe, but I cannot pipe the output of ffmpeg.exe to a named pipe on windows. My definition of the pipes in C#: NamedPipeServerStream p_to_ffmpeg; NamedPipeServerStream p_from_ffmpeg; p_to_ffmpeg = new NamedPipeServerStream("to_ffmpeg", PipeDirection.Out, 1, PipeTransmissionMode.Byte); p_from_ffmpeg = new NamedPipeServerStream("from

ffmpeg output pipeing to named windows pipe

一笑奈何 提交于 2020-04-10 14:48:46
问题 This question is related to my previous question: Converting raw frames into webm live stream I want to pipe a video to ffmpeg and read it back through another pipe, but I cannot pipe the output of ffmpeg.exe to a named pipe on windows. My definition of the pipes in C#: NamedPipeServerStream p_to_ffmpeg; NamedPipeServerStream p_from_ffmpeg; p_to_ffmpeg = new NamedPipeServerStream("to_ffmpeg", PipeDirection.Out, 1, PipeTransmissionMode.Byte); p_from_ffmpeg = new NamedPipeServerStream("from

Ascertain reason for Channel Fault in WCF+NamedPipes

痴心易碎 提交于 2020-03-31 18:00:54
问题 I have a whole sequence of interlinked questions. I would like to know answers for all of them independantly, so *yes*, some of them appear to be X-Y questions; but I do want to know the solution to them anyway!. See end of question for list of other questions in this set. How do I determine the reason for a Channel Fault, e.g. caused by closing the exe on one end of a DuplexChannel connected by named pipes? I have two exes running; communicating over named pipes, via WCF. (If it's relevant,