A client process "C" connects to port 9876.
Inetd accepts the connection, forks, then execs() your perl program
"P".
Your perl program starts a remsh process "S" which connects to
a remote host and process "R".
The process P is running this code:
open(RCMD, "remsh $h -l $u $script |") || die $!; while (<RCMD>) { print $_; }
I think what you are asking is how your Perl program P can detect if the client C exits (or otherwises closes the socket connection). Right now it may wait a long time on <RCMD> and not give an error until the "print $_".
If this is a correct understanding, then what I suggested above should work. The STDIN and STDOUT of your Perl process P are both connected to the socket connection that "C" connected to and inetd accepted. A call to select() or can_read() should detect when that socket connection is closed.
In reply to Re: Re: Re: inetd spawned perl problem
by Thelonius
in thread inetd spawned perl problem
by vasu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |