How can I have output from one named pipe fed back into another named pipe?



I'm adding some custom logging functionality to a bash script, and can't figure out why it won't take the output from one named pipe and feed it back into another named pipe.


Here is a basic version of the script (http://pastebin.com/RMt1FYPc):


#!/bin/bash
PROGNAME=$(basename $(readlink -f $0))
LOG="$PROGNAME.log"
PIPE_LOG="$PROGNAME-$$-log"
PIPE_ECHO="$PROGNAME-$$-echo"
# program output to log file and optionally echo to screen (if $1 is "-e")
log () {
if [ "$1" = '-e' ]; then
shift
$@ > $PIPE_ECHO 2>&1
else
$@ > $PIPE_LOG 2>&1

Related to : How can I have output from one named pipe fed back into another named pipe?
Linux fifo (named pipe) O_NONBLOCK breaks pipe
Network & Servers

I've been writing a small program in C++ for linux using inter process communication. I had a problem when trying to read in a non-blocking way with one process and write (blocking) with another process. The issue looks like this, when the parent tries to read the pipe with O_NONBLOCK (or O_NDELAY) it never reads a single byte and when the child tries to write on the pipe, it fails and the SIGPIPE broken pipe signal is sent. Here is an example of the code:


// Parent process
mkfifo(PROC_COPROC, 0666);
int fd_co = open(PROC_COPROC, O_RDONLY | O_NDELAY);
char c;
int n;
fcntl(fd_co,F_SETFL,0); /
Named-pipe Error: Unable to create named pipe w/err 0x0000007b
Network & Servers

Unable to create named pipe w/err 0x0000007b


I am getting the above error when I try to connect the server and client on different machines.


The code I got from MSDN Link: http://code.msdn.microsoft.com/windowsdesktop/CppNamedPipeCommunication-7447a0bf


I am using Windows 7 machines to communicate.


#define FULL_PIPE_NAME L".pipeSamplePipe"


To communicate with different machines I changed the above line to:


#define FULL_PIPE_NAME L"My Machine's IP addresspipeSamplePipe"


Note: In the same machine itself, it will work only if the path is : L"

Read from a named pipe in bash and pipe it into a java process
Network & Servers

I have a JAVA-Jar-File which is provided by a third-party-dev.
The File reads from STDIN and writes to STDOUT.


I was able to configure the JAR-File to write to a log file instead.


But I also have to rewrite the input-source from STDIN to a named pipe, so I can send commands to the java-pocess via my own application.


I already tried this two things to read from the pipeline (bash):


cat < pipeline_name | java -jar external_application.jar

This works fine for the first command. After receiving the first input line, the 'cat' terminates and I am not able so send commands a

controlling the name of a named pipe when hosting WCF net.pipe binding in IIS
Network & Servers

I have a service accessible via http and net.pipe. It is being hosted in IIS 7 (Server 2008). I may be hosting different instances of this service for several customers on the same machine and hence the HTTP is setup with virtual hostnames etc. This is all working fine.


I thought I would do similar for the net named pipe binding - using some form of
the customers 'virtualhostname' in the named pipe base address, therefore allowing me
to access the different customer instances with different net.pipe urns (I realize
the net.pipe names are URN's not URL's so they can be essentially arbitrary but
I thought I would follow a similar pattern to the HT

How can I have output from one named pipe fed back into another named pipe?
Network & Servers

I'm adding some custom logging functionality to a bash script, and can't figure out why it won't take the output from one named pipe and feed it back into another named pipe.


Here is a basic version of the script (http://pastebin.com/RMt1FYPc):


#!/bin/bash
PROGNAME=$(basename $(readlink -f $0))
LOG="$PROGNAME.log"
PIPE_LOG="$PROGNAME-$$-log"
PIPE_ECHO="$PROGNAME-$$-echo"
# program output to log file and optionally echo to screen (if $1 is "-e")
log () {
if [ "$1" = '-e' ]; then
shift
$@ > $PIPE_ECHO 2>&1
else
$@ > $PIPE_LOG 2>&1
WCF named pipe client notification/detection of pipe state change
Network & Servers

I have two .NET C# windows forms applications that are communicating with each other via WCF named pipes. One of the applications is hosting a WCF service and the other is the client. Communication is working fine, the client can call service methods and callbacks work fine, etc. However, one issue I am having is if the host application shuts down, the client is not able to detect that the pipe is no longer available. I have tried registering event handlers on the pipe for all events (Closing, Closed, Faulted), but these never get called when the host application shuts down. Also, if I try to check the pipe state in the client with the pipe.State property, I get back a state of Opene


Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .