named-pipes

Multiple WriteFile after ERROR_IO_PENDING

寵の児 提交于 2020-03-05 04:55:06
问题 In my application, I am testing the behaviour of WriteFile when another Write operation is pending over the named pipe. Pipe is in message mode (not in byte mode). To make write operation pending, I kept the buffer of named pipe quite small and client sends the more data than buffer size. By this way, I am getting write operation pending at the client end. I am facing the following problem at the server end: ReadFile is failed with ERROR_MORE_DATA . It changes the content of the buffer, but

C# Named Pipes without issuing commands from the Console?

拜拜、爱过 提交于 2020-02-07 05:13:25
问题 I am using Named Pipes to communicate with a process. I have been able to make it work with the following code. (Original code found here : via archive.org ) class ProgramPipeTest { public void ThreadSenderStartClient(object obj) { // Ensure that we only start the client after the server has created the pipe ManualResetEvent SyncClientServer = (ManualResetEvent)obj; using (NamedPipeClientStream pipeStream = new NamedPipeClientStream(".","ToSrvPipe",PipeDirection.Out,PipeOptions.None)) { //

Delete named pipe .NET

北城以北 提交于 2020-02-03 08:13:07
问题 I'm listing my named pipes using this code: private IEnumerable<string> GetNamedPipesList() { string[] listOfAllPipes = Directory.GetFiles(@"\\.\pipe\"); return listOfAllPipes.Where(pipe => pipe.Contains("FST")); } It works fine. I can display them: private void Scan_Click(object sender, EventArgs e) { IEnumerable<string> fsbPipes = GetNamedPipesList(); tbxOutput.Text = string.Empty; foreach (string fsbPipe in fsbPipes) { var pipe = fsbPipe.Replace(@"\\.\pipe\", ""); tbxOutput.AppendText(pipe

How can I tell if there is new data on a pipe?

泄露秘密 提交于 2020-01-25 03:45:09
问题 I'm working on Windows, and I'm trying to learn pipes, and how they work. One thing I haven't found is how can I tell if there is new data on a pipe (from the child/receiver end of the pipe? The usual method is to have a thread which reads the data, and sends it to be processed: void GetDataThread() { while(notDone) { BOOL result = ReadFile (pipe_handle, buffer, buffer_size, &bytes_read, NULL); if (result) DoSomethingWithTheData(buffer, bytes_read); else Fail(); } } The problem is that the

WCF Named Pipes timeout in a WinApp, but not in a ConsoleApp?

瘦欲@ 提交于 2020-01-17 08:35:13
问题 In relation to Async two-way communication with Windows Named Pipes (.Net) which seems dead (the thread that is) :/ I'm wondering why the following code works perfectly in a ConsoleApplications, but when I do exactly the same thing with WindowsApplications I get an timeout on the client when calling "Console.WriteLine(proxy.ProcessData());". The strange thing is that the server method "ProcessData" is called without any exceptions, but still I get a timeout after the default 1 min?! How can I

WCF Named Pipes timeout in a WinApp, but not in a ConsoleApp?

情到浓时终转凉″ 提交于 2020-01-17 08:33:29
问题 In relation to Async two-way communication with Windows Named Pipes (.Net) which seems dead (the thread that is) :/ I'm wondering why the following code works perfectly in a ConsoleApplications, but when I do exactly the same thing with WindowsApplications I get an timeout on the client when calling "Console.WriteLine(proxy.ProcessData());". The strange thing is that the server method "ProcessData" is called without any exceptions, but still I get a timeout after the default 1 min?! How can I

WCF Named Pipe IO Exception - The pipe has been ended. (109, 0x6d)

巧了我就是萌 提交于 2020-01-17 07:08:05
问题 We have a WCF service which calls several other services through Net.Pipes protocol on start up. The call return a list of string, no Enum or complex objects . Sometimes, we receive the following exception. System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe:

WCF Named Pipe IO Exception - The pipe has been ended. (109, 0x6d)

不想你离开。 提交于 2020-01-17 07:08:03
问题 We have a WCF service which calls several other services through Net.Pipes protocol on start up. The call return a list of string, no Enum or complex objects . Sometimes, we receive the following exception. System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe:

reading from named pipes in linux vs OS X

独自空忆成欢 提交于 2020-01-17 04:44:06
问题 The program below works well under OS X but not in linux. It continues to loop through the perror("read error") line, with no bytes in the read buffer, and EWOULDBLOCK isn't the errno (errno=0); In OS X the program works as expected, which is that it reads from three named pipes, and prints any data from any of them to the console. #include <sys/types.h> #include <sys/select.h> #include <sys/time.h> #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> #include

Configure WCF as Named Pipe hosted on IIS7

丶灬走出姿态 提交于 2020-01-17 01:19:32
问题 I have two different WCF services hosted on IIS7. One is Database Service which is configured to run on namedpipe. The other service hosted on same machine is accessing the first service via named pipe and is configured to run on webhttp. however when i call the database service from another service i get the following error "There was no endpoint listening at "net.pipe://localhost/iSPYDBService" that could accept the message. This is often caused by an incorrect address or SOAP action. See