problem about named-pipes-Collection of common programming errors
Frank Hamming
c# .net asynchronous named-pipes
I’m having a problem with NamedPipeServerStream – when my code reads data it’s just repeating the output of the last Read without grabbing the new data.Here’s the smallest server code example that exhibits this behaviour:using System; using System.IO; using System.IO.Pipes; using System.Text;namespace ConsoleApplication1 {class Program{static NamedPipeServerStream NPSS;static void Main(string[] args){string PipeName = “Test1”;// create asynchronous pipe serverNPSS = new NamedPipeServerStream(Pip
user2898278
c++ linux multithreading pipe named-pipes
I am trying to get two threads to communicate through a pipe in C++ on linux (Ubuntu, 12.04, 3.8.13). I just want to write a character from one thread to the pipe, and get the other thread to read it and display it.I am using the clone() function to create threads. This is related to some homework, so I cannot use pthreads or something else.The program:#include <iostream> #include <ctime> #include <cstdlib> #include <cstdio> #include <climits> #include <fstream&g
John Kugelman
c++ c unix named-pipes
I am doing some work in unix with c++. I am trying to create a named pipe between my two programs, and send some text back and forth between them. Everything compiles fine, but when I make my system call to run server.cpp I get this error message../server.cpp: line 8: syntax error near unexpected token ‘(‘ ./server.cpp: line 8: ‘void test()’What is causing this error? I do not have much experience with unix or named pipes so I am kind of stumped.Here is my codeclient.cpp#include <stdio.h>
ThinkingStiff
unix named-pipes max-msp-jitter
I have a Max/MSP standalone that looks for an external folder when it opens (it contains JSON files generated by R), which it does with loadbang -> prefix ~/folder_name. This works OK, but I don’t want to store the folder in home. What I really want is to use Terminal to tell my standalone where to look, something like:open -a standalone.app /var/folders/whatevercrazytempdirname/folder_nameBut this doesn’t work. Maybe I could establish a pipe between the program that generates the folder (R) and
Petr Pervukhin
windows-7 vbscript named-pipes
I’m trying to create named pipe using VBScript on win7. This is my code (took from there):Set fs = CreateObject(“Scripting.FileSystemObject”) Set a = fs.CreateTextFile(“\\.\pipe\PipeName”, True) a.WriteLine(“This is a test.”) a.CloseBut i got an error (manual translate, so may be not accurate):test.vbs(2, 1) Microsoft VBScript runtime error: File not foundSame code with ordinary text file works fine:Set a = fs.CreateTextFile(“.\\PipeName”, True)But, when i tried to escape backslashes:Set a = fs.
Jader Dias
windows named-pipes
In *nix many command line applications that accept file names as arguments accept pipes also. Example:anApplication file.txtAlso works withanApplication | anotherApplication argumentsAnd the result of the “anotherApplication” is redirected to “anApplication” as it was a fileI learned that the Windows equivalent to this is a “named pipe”. I wonder if the command line application must be aware of named pipes to understand it, or if any command line application that accepts a file as argument would
Dmitri Pisarenko
delphi delphi-2009 named-pipes
I have a Delphi application, which sends piece of text to a named pipe via callSendMessageToNamedPipe(hPipe, CurMsg);It works fine for some messages, but sending other texts leads to a crash of the application.The only difference between normal and “crashing” messages I’m aware of is that the crashing messages contain lots of Cyrillic characters.How should I encode them in order for the aforementioned call to be executed properly?Update 1: Here’s the implementation of SendMessageToNamedPipe.proc
Andrew Shepherd
wcf wcf-binding named-pipes netnamedpipebinding
I’m trying to use WCF named pipes in a web site, and it’s failing with errors:There was no endpoint listening at net.pipe://localhost/mypipenamethat could accept the message. This is often caused by an incorrectaddress or SOAP action. See InnerException, if present, for moredetails.and the InnerException:The pipe name could not be obtained for net.pipe://localhost/mypipename.and there is another inner exception giving an access denied message.My web site is using impersonation, and looking aroun
Kalec
c named-pipes
Edit: Here is the entire code, ignore Romanian comments. Also 2 or 3 names are untranslated from Romanian: http://pastebin.com/JjtayvXXI am trying to learn the basics of OS, now I’m working with named pipes under windows and I can’t tell what’s wrong.Honestly I’m working off an example a friend did, but he’s just as bad as me if not worse. While hi’s program works (albeit it does something else), he can’t explain anything, most likely just copied from somewhere, still … not important, what I w
sgowd
osx posix semaphore named-pipes npapi
On windows, I solved this issue by creating a named semaphore. If plugin 1 crashes while holding the semaphore, the semaphore is released. But its not the case with Posix (on Mac), where the semaphore stays alive. Since, sigaction will not release the SIGKILL on the semaphore, I have to abandon it.What is my best option.named pipes, ports, message queue, remote function execution?
user1121956
c# named-pipes
I’m wondering how safe is data transfer via named pipes using System.IO.Pipes (without WCF)Is it required to check e.g. md5 sum after data transfer or maybe it would be better idea to implement transactions for it and if so is there any straight way for it without using P/Invoke to TransactNamedPipe (I guess there is no wrapper in .net)?Or maybe TCP is just safier than named pipes?EDIT:Additionally:What I really have in mind is what will happen if server or client crash – what about delivery the
PetPaulsen
c# named-pipes virtual-pc
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 and I am try
Soner Gönül
c# wcf named-pipes antivirus
I am seeing a strange issue with my application, it uses NamedPipes for IPC communication. The only file that ever gets transferred over it is an serialized to xml object. I have not seen the issues locally on my pc, as I guess my antivirus is not scanning them, but I have a few customers who are seeing issues where they get timeout messages and pipe failures. If they disable the antivirus realtime scanner it works just fine. What made us suspect the antivirus is a customer was complaining that
HighCore
c# wcf service named-pipes reliability
Say I have a proxy that sends a message to a WCF server:NetNamedPipeBinding b = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); b.MaxConnections = 1000000; EndpointAddress address = new EndpointAddress(@”net.pipe://sendmessage”); channelFactory = new ChannelFactory<ISendMessage>(b, address); proxy = channelFactory.CreateChannel(); proxy.SendMessage(“Hello, world.”);Say the SendMessage function has a one-way OperationContract:[OperationContract(IsOneWay=true)] void SendMessage(strin
Javier J. Salmeron Garcia
ipc named-pipes blocking nonblocking
I am writing a bash program that has IPC between two proccesses (A and B) via named pipes. I am worried because if A crashes, B may be blocked indefinitely (and vice versa), because named pipes are blocking. Can I link A and B so, if A crashes, force B to crash too? Any other alternatives to solve this blocking problem would be appreciated. Thank you in advance.
Adam Plocher
c# .net wcf named-pipes
I’m trying to port some of my old .NET Remoting IPC code over to WCF Named Pipes and I know I’m probably doing something stupid here…I have a Windows Service using a ServiceHost/NetNamedPipeBinding endpoint.I have a WinForms UI connecting to it with the ChannelFactory/NetNamedPipeBinding.Regardless of if the Windows Server is running or not, after I do CreateChannel on the client, the ChannelFactory object State is Opened. I would expect it to be something other than ‘Opened’ if the service i
caf
asp.net sql-server connection named-pipes
For some reason every 3-5 days our web app loses the ability to open a connection to the db with the following error, the strange thing is that all we have to do is reboot the container (it is a VPS) and it is restored to normal functionality. Then a few days later or so it happens again. Has anyone ever had such a problem? I have noticed a lot of ANONYMOUS LOGONs in the security log in the middle of the night from our AD server which is strange, and also some from an IP in Amsterdam. I am not s
user1689571
wcf scheduled-tasks named-pipes
I created a process monitoring program (C#) that uses WCF to handle logging from a number of processes that I am running on a server. Everything is local to the server, and the WCF base address is “net.pipe://localhost/ServiceDebugHost”. When I run them from Explorer, they open the connection to the monitoring program and send it messages, which it displays.However, when I run them under the Task Scheduler (Windows Server 2008R2), no messages arrive. I have the scheduled task run under an ad
Gayan
named-pipes
I’m getting following error when i try to open a another connection in name pipe System.IO.IOException was unhandled HResult=-2147024665Message=All pipe instances are busy.how can I remove all pipe instance?
fonZ
c++ qt named-pipes
I made 2 threads, one has to read the other has to write. But i get undefined behaviour, sometimes i can read 1 line, sometimes 1000. It does not make alot of sense to me.What i do is the following: 1. i create a fifo with mkfifo() in main.cpp 2. i start 2 threads, one that reads, the other writes. reader.cpp, writer.cppIn those threads, every loop i open the fifo and i close it, because it wont work if i only do that once outside the loop, which i find also strange.I have been looking for good
Yevgeniy P
c unix concurrency named-pipes manualresetevent
Say i have a fifo (named pipe) which gets open multiple times from multiple processes or threads. All of them will call select() for read concurrently. If a writer comes in and writes, say one byte to this fifo, will all blocked select() calls return simultaneously or will only one thread be chosen and return from select()?Is there any specification on this or would this be system-dependent?The reason i m asking is that i want to implement Windows-like manual reset events using fifos. Manual
Eduard Luca
c named-pipes fifo
I am building a server that communicates through FIFO with it’s clients.So far I’ve managed to create a FIFO, run a new thread, once a message arrives in the FIFO and output the message from the thread.The problem is that as soon as the client writes something in the pipe, the server just prints the message endlessly (I am reading from the pipe in a while(1)).My question is: shouldn’t the read operation also remove the message from the pipe, so it doesn’t get read again? Isn’t that the point of
Laurent Etiemble
c ipc named-pipes
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);fd = open(“np”, O_RDONLY);read(fd, ch, 1);close(fd);printf(“%c\n”, ch[0]);return; }What I want is for main to block till something is written to the pipe. The problem is that the signal handl
WaveformDelta
ruby named-pipes blocking
I’m trying to set up a Ruby script that reads from a named pipe in a loop, blocking until input is available in the pipe.I have a process that periodically puts debugging events into a named pipe:# Open the logging pipe log = File.open(“log_pipe”, “w+”) #’log_pipe’ created in shell using mkfifo … # An interesting event happens log.puts “Interesting event #4291 occurred” log.flush …I then want a separate process that will read from this pipe and print events to the console as they happen. I’
hmjd
visual-c++ memory activex named-pipes
Our application navigates through a list of named pipes and looks for a named pipe created by our application. If our named pipe does not exist, we go ahead and create one. However, lately our clients have reported application crashes at line:fileName = std::wstring(TmpInfo->FileName);You could review the windbg crash dump report that is attached below. The crash is sporadic and not reproducible at all times. Could you help me identify the issue? Is there an issue in converting TmpInfo->F
kambamsu
qt ipc named-pipes
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) and another tab/window which tries to connect to this. But this doesn’t seem to work. When i do a client->errorString() it prints out “Unknown Error”.Any help on wh
Web site is in building