NAME

PerlIO::via::Timeout::Strategy::SetSockOpt - a PerlIO::via::Timeout::Strategy, the uses setsockopt

VERSION

version 0.14

SYNOPSIS

my $strategy = PerlIO::via::Timeout::Strategy::SetSockOpt->new(
    read_timeout => 1,
    write_timeout => 2,
);

DESCRIPTION

This class implements a timeout strategy to be used by PerlIO::via::Timeout. It will work only on sockets, as it uses setsockopt.

METHODS

new

Constructor of the strategy. Takes as arguments a list of key / values :

read_timeout

The read timeout in second. Can be a float

write_timeout

The write timeout in second. Can be a float

timeout_enabled

Boolean. Defaults to 1

is_valid

$strategy->is_valid()

Returns wether the socket from the strategy is still valid.

SEE ALSO

PerlIO::via::Timeout

AUTHOR

Damien "dams" Krotkine

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Damien "dams" Krotkine.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.