Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: IO::Socket::UNIX unexpected death

by targetsmart (Curate)
on Jun 30, 2009 at 11:09 UTC ( #775980=note: print w/ replies, xml ) Need Help??

in reply to IO::Socket::UNIX unexpected death

the writer dies, without any message, explanation or exception
Did you tried trapping signal SIGPIPE?

I have not found a way in the writer to check if the socket is still usable. Is there something I can use for this purpose?
eof might help you to find out whether the filehandle is closed or open, before doing further write on the filehandle

-- 'I' am not the body, 'I' am the 'soul', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.

Comment on Re: IO::Socket::UNIX unexpected death
Replies are listed 'Best First'.
Re^2: IO::Socket::UNIX unexpected death
by lom (Sexton) on Jun 30, 2009 at 11:37 UTC

    Did you tried trapping signal SIGPIPE?
    I did not try that, and SIGPIPE can be and indeed is trapped on the second print. From there, I should be able to properly deal with this case. Thanks a lot for this! I am surprised there is no other OOish way to find that out before the actual write, though.

    eof might help you to find out whether the filehandle is closed or open
    eof ($write) is actually blocking in the write script, so not really of use to me in this instance. It might be because of the way the socket is opened, only for writing, not for reading?

    Thanks a lot for you insight.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://775980]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-11-29 07:07 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (748 votes), past polls