Russ has asked for the wisdom of the Perl Monks concerning the following question:
How do you trap a broken pipe error? For instance the following function reads until an \n is found, however if the client in this case is a browser, and it does not send the \n, but instead hits the stop button , the server dies with Broken Pipe error.
Anyone know how to properly trap a broken pipe error?
eval { if( !( print_errs( $got = Net::SSLeay::ssl_read_all($ssl)))){ if ( $got ne ''){ Net::SSLeay::ssl_write_all($ssl, $got) or die "$$: ssl write fai +led"; print "$got\n"; } } } || print "ERRORZ\n"; #I never get here due to an untrapable broken p +ipe error
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: How does one trap a Broken Pipe (Moved from Q&A)
by jeffa (Bishop) on Dec 07, 2000 at 21:56 UTC |