send2pipe : 12456478798|#|TBB|#||#|363|#|28186|#|2818600|#|400|#|0|#|N|#|JT|#|N|#|P|#||#||#||#|16|#|5|#||#|0.000000|#|26941549169310|#||#||#||#|1|#|TBB|#|N|#|2814400|#|01152|#|0|#|N|#|Y|#||#||#|END successfully passed to fifoI see nothing in the log of the receiving program. While the receiving program writes out the message on the very first occasion after the read.
mkfifo /data/pipe/pipefileToJava
echo send2pipe : sending stream $Payload to $PipeFile echo $Payload > $PipeFile & sleep 1 if kill %1 >/dev/null 2>&1 then echo send2pipe : could not connect to pipe else echo send2pipe : "$Payload" successfully passed to fifo exit 0 fi
fr=new FileReader(s_named_pipe_path); br=new BufferedReader(fr);The java code 'hangs' on the
br.readLine()Until there is a message. It reads it, logs it.
logger.info("Retrieving a message ..." + line);And it closes the file:
fr.close(); br.close();Then it goes to the top of the loop, to reopen the pipefile.
while(continueProcessing) { fr=new FileReader(s_named_pipe_path); br=new BufferedReader(fr); while((line=br.readLine())!=null) { logger.info("Retrieving a message (count since start: "+ (NumberMessagesReceived++) + ") from named pipe: " + s_named_pipe_path + ": " + line); } if(fr!=null) { logger.info("Closing file reader"); fr.close(); } if(br!=null) { logger.info("Closing buffered reader"); br.close(); } }
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE