N
norm4h8
Hi!
I have a question about how to create a process in such a way that it
would terminate itself if its wated for input for too long.
Here is the story. I have 2 different files, say R.c and S.c, which
have a named pipe between them and send each other signals. R process
starts first, it opens a named pipe and waits for S to connect. S
connects to the pipe, writes something to it and sends the signal to R
indicating that R can read. When R receives a signal from S, it reads
the data, sends the signal back to S that the data was read, and
suspends waiting for another signal from S to read again, and so on.
My question is when R just starts and waits for S to connect, in case S
doesn't connect, so that R would wait indefinitely, is there a way to
set a clock or something in R to terminate after some time, without
affecting the rest of the execution in case S does connect.
Sorry if my explanation is a little all over the place...
I'd really appreciate any help or any ideas.
Thanks a lot
norm4h8
I have a question about how to create a process in such a way that it
would terminate itself if its wated for input for too long.
Here is the story. I have 2 different files, say R.c and S.c, which
have a named pipe between them and send each other signals. R process
starts first, it opens a named pipe and waits for S to connect. S
connects to the pipe, writes something to it and sends the signal to R
indicating that R can read. When R receives a signal from S, it reads
the data, sends the signal back to S that the data was read, and
suspends waiting for another signal from S to read again, and so on.
My question is when R just starts and waits for S to connect, in case S
doesn't connect, so that R would wait indefinitely, is there a way to
set a clock or something in R to terminate after some time, without
affecting the rest of the execution in case S does connect.
Sorry if my explanation is a little all over the place...
I'd really appreciate any help or any ideas.
Thanks a lot
norm4h8