Perl: the Markov chain saw | |
PerlMonks |
"Operation now in progress" problem with a pipeby mje (Curate) |
on Nov 21, 2016 at 15:54 UTC ( [id://1176256]=perlquestion: print w/replies, xml ) | Need Help?? |
mje has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks. I have some perl reading messages from a socket and then taking action on them. The server end of the socket expects to get a "heartbeat" msg every so often. The actions sometimes take too long and the heartbeat is not sent so the code was converted to fork a child something like this:
and all the child_writer() does is:
The problem is that although the above fixed the heartbeat issue the parent was still trying to do too much so now the parent forks other processes to handle different events received and they are all effectively writing something down the same pipe to the child above.. Occasionally what happens is I get an error writing to the pipe from code like this:
and the the last warning sometimes outputs "Write to child_writer failed - Operation now in progress". I don't understand this since the write end of the pipe is blocking and so how can I get EINPROGRESS errror? Any ideas?
Back to
Seekers of Perl Wisdom
|
|