App-Diskd
view release on metacpan or search on metacpan
lib/App/Diskd.pm view on Meta::CPAN
}
# socket_error() is called to handle "sock_error" events. These
# events can come from two places: The SocketFactory will send it if a
# connection fails, and the ReadWrite object will send it if a read or
# write error occurs.
# The most common way to handle I/O errors is to shut down the sockets
# having problems. Here we'll delete all our wheels so the program
# can shut down gracefully.
# ARG0 contains the name of the syscall that failed. It is often
# "connect" or "bind" or "read" or "write". ARG1 and ARG2 contain the
# numeric and descriptive contents of $! at the time of the failure.
sub socket_error {
my ($heap, $syscall, $errno, $error) = @_[HEAP, ARG0 .. ARG2];
$error = "Normal disconnection." unless $errno;
warn "Client socket encountered $syscall error $errno: $error";
delete $heap->{connect_wheel};
delete $heap->{io_wheel};
delete $heap->{cli_wheel};
}
( run in 0.985 second using v1.01-cache-2.11-cpan-2398b32b56e )