named-pipes

Async two-way communication with Windows Named Pipes (.Net)

随声附和 提交于 2019-11-28 04:35:08
I have a windows service and a GUI that need to communicate with each other. Either can send messages at any time. I'm looking at using NamedPipes, but it seems that you cant read & write to the stream at the same time (or at least I cant find any examples that cover this case). Is it possible to do this kind of two-way communication via a single NamedPipe? Or do I need to open two pipes (one from GUI->service and one from service->GUI)? Using WCF you can use duplex named pipes // Create a contract that can be used as a callback public interface IMyCallbackService { [OperationContract(IsOneWay

How to create a named pipe in node.js?

大兔子大兔子 提交于 2019-11-28 04:09:34
How to create a named pipe in node.js? P.S.: For now I'm creating a named pipe as follows. But I think this is not best way var mkfifoProcess = spawn('mkfifo', [fifoFilePath]); mkfifoProcess.on('exit', function (code) { if (code == 0) { console.log('fifo created: ' + fifoFilePath); } else { console.log('fail to create fifo with code: ' + code); } }); Looks like name pipes aren't and won't be supported in Node core - from Ben Noordhuis 10/11/11: Windows has a concept of named pipes but since you mention mkfifo I assume you mean UNIX FIFOs. We don't support them and probably never will (FIFOs in

How to capture output of execvp

删除回忆录丶 提交于 2019-11-28 01:52:17
问题 I'm developing a program which executes a program using execvp. It needs to capture the results of the child process and parse them in the main process. It seems there is a way, using named pipes, and duping. I'm trying to hunt down a good example of this, but so far no luck. If anyone has any pointers, links and/or suggestions about this, I'd greatly appreciate it. 回答1: You don't need named pipes; unnamed pipes work just fine. Actually, often you can just use popen instead of doing the pipe

WCF NamedPipe CommunicationException - “The pipe has been ended. (109, 0x6d).”

谁说我不能喝 提交于 2019-11-27 23:20:09
问题 I am writing a Windows Service with accompanying "status tool." The service hosts a WCF named pipe endpoint for inter-process communication. Through the named pipe, the status tool can periodically query the service for the latest "status." On my development machine, I have multiple IP Addresses; one of them is a "local" network with a 192.168.1.XX address. The other is the "corporate" network, with a 10.0.X.XX address. The Windows Service collects UDP multicast traffic on a single IP Address

Named Pipe Server throws UnauthorizedAccessException when creating a seccond instance if PipeSecurity is set

烂漫一生 提交于 2019-11-27 22:49:22
I am trying to write a (elevated privilege) service that will talk to a non privileged winforms application. I was able to have two console applications (one elevated one not) talk back and forth no problem but I am having a problem doing a service and a winforms app. The first instance of the pipe works perfectly. However after my client connects and I try to create a new instance so it will be ready if a 2nd client connects, but the constructor for NamedPipeServerStream throws a exception System.UnauthorizedAccessException was unhandled Message=Access to the path is denied. Source=System

Python read named PIPE

£可爱£侵袭症+ 提交于 2019-11-27 20:17:50
I have a named pipe in linux and i want to read it from python. The problem is that the python process 'consumes' one core (100%) continuously. My code is the following: FIFO = '/var/run/mypipe' os.mkfifo(FIFO) with open(FIFO) as fifo: while True: line = fifo.read() I want to ask if the 'sleep' will help the situation or the process going to loss some input data from pipe. I can't control the input so i don't know the frequency of data input. I read about select and poll but i didn't find any example for my problem. Finally, i want to ask if the 100% usage will have any impact on the data

PipeTransmissionMode.Message: How do .NET named pipes distinguish between messages?

最后都变了- 提交于 2019-11-27 19:59:33
Can somebody clarify the meaning of PipeTransmissionMode.Message in .NET? How does .NET distinguish one message passed through the pipe from another? Can I serialize an object using a BinaryFormatter and then pass it through the pipe as a message? Or are only string messages allowed when the pipe is in PipeTransmissionMode.Message mode? Chris Dickson The pipe transmission mode is a Windows operating system concept, not a .NET concept. If a pipe is created in Message mode, each write to the pipe by the sender is treated as a separate message. The receiver can read from the pipe either: in Byte

Named pipe does not wait until completion in bash

旧巷老猫 提交于 2019-11-27 19:41:21
问题 In the following test.jl creates an output.txt and generates some console output. console output is very well handled. but control returns immediately after echo even before output.txt is created completely. placing a wait in between echo and mv causes an indefinite wait. Should a carriage return be passed to the pipe without killing the pipe yet? mkfifo pipe sleep 1000000 > pipe & julia <pipe >stdout.txt 2>stderr.txt & echo "include(\"test.jl\")" > pipe mv output.txt temp/ echo "include(\

Is it possible to change the size of a named pipe on Linux?

南楼画角 提交于 2019-11-27 17:54:18
问题 I know that for the current version of the Linux kernel, the size of named pipes is 64K. Is it possible to increase this size at all? I know I can switch to sockets, but first I'd like to see if I can solve an intermittent buffer-overflow problem by just increasing the named-pipe size. 回答1: With recent kernels (>= 2.6.35), you can change the size of a pipe with fcntl(fd, F_SETPIPE_SZ, size) where size is a long . The maximum size is in /proc/sys/fs/pipe-max-size . 来源: https://stackoverflow

PhantomJS: pipe input

断了今生、忘了曾经 提交于 2019-11-27 17:35:25
问题 I am trying to use PhantomJS to render an html page to pdf. I do not want to write the files to disk, I have the html in memory, and I want the pdf in memory. Using the excellent answer from Pooria Azimi at this question, i am able to get the pdf from a named pipe. When trying the same on the other end (replacing the input file with a named pipe), I end up with a blank pdf. This is what I am doing now (simplified): mkfifo in_pipe.html out_pipe.pdf ./phantomjs rasterize.js in_pipe.html out