named-pipes

COM port communication with Virtual PC

[亡魂溺海] 提交于 2019-12-08 07:16:57
问题 I am testing an application that uses the COM-Port. The application is running in Virtual PC. I have set up the Virtual PC settings to use the named pipe \.\pipe\mypipe for COM1-Port. Now I am trying to communicate with this named pipe using C#. using (var pipe = new NamedPipeServerStream(@"\\.\pipe\mypipe")) { pipe.WaitForConnection(); using (var reader = new StreamReader(pipe)) { // Do some communication here } } The program is waiting at WaitForConnection() although Virtual PC is running

How to read from Windows Named Pipe with timeout?

自作多情 提交于 2019-12-08 06:09:18
问题 I'm trying to port something that is very easy in Unix to Windows: reading from a named pipe (fifo) with timeout when nothing happened. I'm trying to do it in a simple way (using PeekNamedPipe ), without using overlapped IO. Is this possible? Below is a complete example. It doesn't work for the moment: The written string is not received, and the reader gets ERROR_NO_DATA 232 (0xE8) The pipe is being closed after the first read, and the writer gets this after some tries ERROR_SEM_TIMEOUT 121

Can't do blocking read from named pipe (FIFO) in Linux

感情迁移 提交于 2019-12-08 01:18:09
问题 It is very weird that I can't seem to make this work. This is my architecture: I have a named pipe which will communicate between a always-running root reader process and multiple application writer processes. The reader process has to be blocking while the writers are nonblocking . Therefore this is what I do in the reader process which will run with root privilege. reader.c #define PIPE_ID "/dev/shm/mypipe" // This function configures named pipe void configure_pipe() { // So that others can

Async NamedPipes in case of multiple pipe server instances

て烟熏妆下的殇ゞ 提交于 2019-12-07 23:27:44
问题 I'm using code from this article with only difference that maxNumberOfServerInstances is set to -1 (number of server instances with the same pipe name is limited only by system resources) in NamedPipeServerStream constructor Async Listen Method [Listen Server Class]: class PipeServer { string _pipeName; public void Listen(string PipeName) { try { // Set to class level var so we can re-use in the async callback method _pipeName = PipeName; // Create the new async pipe NamedPipeServerStream

How to call net.pipe (named pipe) WCF services while impersonating in a Windows Service

半城伤御伤魂 提交于 2019-12-07 19:51:22
问题 I am having an issue calling a WCF service over net.pipe with Windows impersonation from a C# Windows service. Background The service reads from a queue and creates children app domains, each running a particular module per the item pulled from the queue. We call the Windows service a “JobQueueAgent” and each module a “Job”. I will use these terms going forward. A job can be configured to run as a specified user. We use impersonation inside the job’s app domain to accomplish this. The

WCF HTTP and NamedPipe service

假装没事ソ 提交于 2019-12-07 18:58:25
I'm creating a WCF service which, at the moment, exposing a number of contracts using a basicHttpBinding. However, I now want to use the service locally on the same machine, and a netNamedPipeBinding seems more appropriate in terms of performance. For that reason, I want to expose the service using a named pipe and HTTP. At the moment I'm doing this with the following configuration: <service name="WCFService.MyService" behaviorConfiguration="serviceBehaviour"> <host> <baseAddresses> <add baseAddress="http://localhost:8080/MyService" /> <add baseAddress="net.pipe://localhost/MyService" /> <

Named Pipe Server & Client - No Message

笑着哭i 提交于 2019-12-07 15:00:47
问题 I am trying to learn how to do Named Pipes. So I created a Server and Client in LinqPad. Here is my Server: var p = new NamedPipeServerStream("test3", PipeDirection.Out); p.WaitForConnection(); Console.WriteLine("Connected!"); new StreamWriter(p).WriteLine("Hello!"); p.Flush(); p.WaitForPipeDrain(); p.Close(); Here is my Client: var p = new NamedPipeClientStream(".", "test3", PipeDirection.In); p.Connect(); var s = new StreamReader(p).ReadLine(); Console.Write("Message: " + s); p.Close(); I

Two way communication using Cromis IPC

折月煮酒 提交于 2019-12-07 10:29:13
问题 I've downloaded and had a play with the Cromis IPC components from Iztok Kacin. I've downloaded this component set to allow my windows service and GUI to communicate. However it seems that the communication is one way(apart from server responses). I can quite happily send a message from a client to a listening server, but I don't appear to be able to send a message back to the client unless it is as a response. Does anyone know if two way comms are achievable with these components or am I

IPC: Using of named pipes in c++ between two programs

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 04:48:36
问题 I'm trying to realise a IPC between two different programs running on the same machine (in my case its a CentOS7). To have just a kind of loose coupling I decided to use a named pipe for the IPC. Therefore I'm was playing with the following example and ran into different problems. Creating and writing into the pipe: #include <sys/types.h> #include <sys/select.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include

Win32 named pipes and message size limits - is the old 64K limit still applicable?

老子叫甜甜 提交于 2019-12-07 04:08:22
问题 Win32 used to have a message size limit of 64K for message-mode pipes, as witnessed by the remnants of KB article Q119218 PRB: Named Pipe Write() Limited to 64K. The "applies to" section lists only "Microsoft Win32 Application Programming Interface" and the article is rather old; there is no indication whether it also applies to reasonably current versions like Windows 7. Is there any reliable, current information on the issue? The current online documentation contains only nebulous hints at