SiouxCityElvis
Programmer
I need help understanding the usage of named pipes.
We have java programs that will be populating the named pipe located in my Unix environment. I am using COBOL to perform searches in files based off the query data sent to me from Java via the named pipe.
I have gone to the Liant website as I am using RMCOBOl 85. They had a very elementary example of a name pipe. Basically, it consited of a COBOL program that wrote to the named pipe, and a COBOL program that read from the Named pipe. So, in the end at the prompt I would enter:
runcobol WP | pipefile | runcobol RP and it worked.
My question is, what code would be necessary to know when to go read the named pipe? I other words, in the example above, I knew that I already compiled a writing program and a reading program and all I had to do was run my executable command.
But, basically, I don't understand what code would be necessary for my COBOL program to sit and wait and "listen" to see if the named pipe is filled with a request from the Java and then to perform the query search based off of the request sitting in the named pipe? would that mean that my cobol program would be perpetually running, waiting for requests, fulfilling the requests and sending back the response, and then waiting again for more requests?
I'm really confused on how to go about this, but I have to somehow get this to work using Named Pipes.
Please help! Thanks.
-David
We have java programs that will be populating the named pipe located in my Unix environment. I am using COBOL to perform searches in files based off the query data sent to me from Java via the named pipe.
I have gone to the Liant website as I am using RMCOBOl 85. They had a very elementary example of a name pipe. Basically, it consited of a COBOL program that wrote to the named pipe, and a COBOL program that read from the Named pipe. So, in the end at the prompt I would enter:
runcobol WP | pipefile | runcobol RP and it worked.
My question is, what code would be necessary to know when to go read the named pipe? I other words, in the example above, I knew that I already compiled a writing program and a reading program and all I had to do was run my executable command.
But, basically, I don't understand what code would be necessary for my COBOL program to sit and wait and "listen" to see if the named pipe is filled with a request from the Java and then to perform the query search based off of the request sitting in the named pipe? would that mean that my cobol program would be perpetually running, waiting for requests, fulfilling the requests and sending back the response, and then waiting again for more requests?
I'm really confused on how to go about this, but I have to somehow get this to work using Named Pipes.
Please help! Thanks.
-David