Main > Free Download Search >

Free 15.15s software for linux

15.15s

Sponsored Links
Sponsored Links
Sort by >> Relevance
rss
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1
POE::Component::Client::Ping 1.13

POE::Component::Client::Ping 1.13


POE::Component::Client::Ping is a non-blocking ICMP ping client. more>>
POE::Component::Client::Ping is a non-blocking ICMP ping client.

SYNOPSIS

use POE qw(Component::Client::Ping);

POE::Component::Client::Ping->spawn(
Alias => "pingthing", # defaults to "pinger"
Timeout => 10, # defaults to 1 second
Retry => 3, # defaults to 1 attempt
OneReply => 1, # defaults to disabled
Parallelism => 20, # defaults to undef
BufferSize => 65536, # defaults to undef
AlwaysDecodeAddress => 1, # defaults to 0
);

sub some_event_handler {
$kernel->post(
"pingthing", # Post the request to the "pingthing" component.
"ping", # Ask it to "ping" an address.
"pong", # Have it post an answer as a "pong" event.
$address, # This is the address we want to ping.
$timeout, # Optional timeout. It overrides the default.
$retry, # Optional retries. It overrides the default.
);
}

# This is the sub which is called when the session receives a "pong"
# event. It handles responses from the Ping component.
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];

my ($req_address, $req_timeout, $req_time) = @$request;
my ($resp_address, $roundtrip_time, $resp_time, $resp_ttl) = @$response;

# The response address is defined if this is a response.
if (defined $resp_address) {
printf(
"ping to %-15.15s at %10d. pong from %-15.15s in %6.3f sn",
$req_address, $req_time,
$resp_address, $roundtrip_time,
);
return;
}

# Otherwise the timeout period has ended.
printf(
"ping to %-15.15s is done.n", $req_address,
);
}

or

use POE::Component::Client::Ping ":const";

# Post an array ref as the callback to get data back to you
$kernel->post("pinger", "ping", [ "pong", $user_data ]);

# use the REQ_USER_ARGS constant to get to your data
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my $user_data = $request->[REQ_USER_ARGS];
...;
}

<<less
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads

15.15s related searches

: ,
Secleted [ 0 ] software to compare
  • Page: 1 of 1
  • 1