named-pipes

Using named pipes in a single process

I am trying to use a named pipe for communication within a process. Here is the code #include <stdio.h> #include <fcntl.h> #include <signal.h> void sigint(int num) { int fd = open("np", O_WRONLY); write(fd, "y", 1); close(fd); } main() { char ch[1]; int fd; mkfifo("np", 0666); signal(SIGINT, sigint); ...

WCF named pipes service settings

Is it worth to set the service with ConcurrencyMode.Multiple and InstanceContextMode.Single attributes to save some performance when using named pipes ? I mean when I do so I have to bother with multithreading issues. ...

Should I use DTO over WCF (namedPipes) or not !?

I mean If I was using WCF over http I wouldn't hesitate. My ORM is LLBLGen Pro which provides me with some pretty nice entity collections features, like tracking changes and other. If I would go the DTO path I would lost this functionality. For now there is on the client side a Web app, which does not need any tracking changes funcional...

WCF Service design question and a Grid on the client side

I'm thinking about how to design my service, especially the part which will provide data for an gridview on the clien side. The GridView needs this data: -A list of objects -Count of all records The question is: Should I create one method for getting these data which will return an object which would includes the count and the list....

.NET IpcChannel doesn't reliably clean up properly?

For some reason, after using an IpcChannel and shutting it down, sometimes the namedpipe stays open, with a thread waiting on it. I cannot make this happen on demand in a debug environment, but it happens 5 to 10 times per day in our production environment. The bad effect this is having is that it is stopping me from unloading the appd...

Intrasession Communication with .NET Remoting

I have an application that needs to be called upon by a second application. These applications need to find each other without configuration (preferably without touching the registry) and function in a terminal services environment properly. I have heard that .net remoting using named pipes may be a way to accomplish this but I do not ...

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 from a server. The server sends data updates to the client. Read is a blocking call. If...

WPF access GUI from other thread

Hi, I am working through the requirement to make a WPF Application single instance only. However - I have to pass the command line to the first instance and then perform some UI action. I am using a Mutext to check for already running instances, I do use NamedPipes to transfer the command line to the already running instance. But of ...

How to detect a client disconnect using a named pipe client/server?

I'm learning about named pipes and was playing with the named pipe client and server examples from the MSDN doc: Named Pipe Server Named Pipe Client I modified the client so I can type in messages to the console and have them sent to the server where it displays the message and sends back a reply. Essentially I added a loop which star...

Concurrent reading and writing to NamePipeClientStream

I have a NamedPipeClientStream instance in my application that is setup for duplex communication (PipeDirection.InOut). I also have two threads, a read thread and a write thread. I want to have the read thread call only the NamedPipeClientStream.Read method, and the write thread only call the NamedPipeClientStream.Write method. They w...

Windows - Named pipes performance recommendations with C#

I am currently evaluating named pipes for IPC on Windows with .NET/C#. I am currently looking at a single producer, single consumer scenario. Are there any good performance consideration guidelines? In my first test case I was comparing the speed of large messages vs small messages and seems to be that large (64k) messages are sent as qu...

Is NetNamedPipeBinding binding guaranteed to work only on the same machine?

Hi, I've created a Windows Service that uses WCF for communications to it. The service should be used be called only from the same machine. If I can guarantee that there's no way to communicate with it from another machine, I can consider it secured. Since I'm using communications on a single machine, I opted to used NetNamedPipeBindi...

Using named pipes in Rails

I need to read and write some data through named pipes. I have tested it in a simple Ruby app, and it works nice. But I dont know, where should i put it in my Rails app? I have heard about Rake tasks, but i don't sure, is it right solution. I need to open a pipe-file, and listen to data. If there is any, i need to process it and make ...

Can we host a Workflow Service as a Windows Service?

I am working on a logging application that requires me to have a Workflow that is exposed as a Service (Workflow Service). We want to host it as a Windows Service (don't want to host workflow service as .svc file in IIS). Another reason for having it as windows service is to be able to communicate with the service through the Named pipes...

Why doesn't my NamedPipeServerStream wait??

I'm working with a NamedPipeServerStream to communicate between two processes. Here is the code where I initialize and connect the pipe: void Foo(IHasData objectProvider) { Stream stream = objectProvider.GetData(); if (stream.Length > 0) { using (NamedPipeServerStream pipeServer = new NamedPipeServerStream("Visualiz...

How to read/write from erlang to a named pipe ?

I need my erlang application to read and write through a named pipe. Opening the named pipe as a file will fail with eisdir. I wrote the following module, but it is fragile and feels wrong in many ways. Also it fails on reading after a while. Is there a way to make it more ... elegant ? -module(port_forwarder). -export([start/2, forwa...

C++: Implementing Named Pipes using the Win32 API

I'm trying to implement named pipes in C++, but either my reader isn't reading anything, or my writer isn't writing anything (or both). Here's my reader: int main() { HANDLE pipe = CreateFile(GetPipeName(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); char data[1024]; DWORD numRead = 1; while (num...

Java/C++ communication via pipe on Windows

Hi, I have two separate programs, one in Java and one in C++, both running on Windows. We need to do bidirectional interprocess communication between the two. Up until now, we were using this awkward solution of writing to text files and reading them on the other side, where the producer would generate a .lock file when it's done writi...

Qt IPC - Named Pipes

Hi, I'm developing a qt browser plugin and want to implement named pipes in it. I tried the basic fortune cookie example provided with the QLocalSocket and QLocalServer in an exe and it works fine. But when i try to implement a similar thing in the browser plugin, making a page where the plugin is present listen to a name (like a server...

Is there a better way to write named-pipes in F#?

Hi I am new to F#. I am trying to communicate with java from F# using named pipe. The code below works but I am not sure if there is a better way to do this (I know the infinite loop is a bad idea but this is just a proof of concept) if anyone have any idea to improve this code please post your comments. Thanks in advance Sudaly open...