Lines Matching refs:host

51 # compatibility with the original Net::Ping.  It accepts a host
53 # object and try pinging the host. The result of the ping is returned.
57 my ($host, # Name or IP number of host to ping
63 $p->ping($host); # Going out of scope closes the connection
337 # Description: Ping a host name or IP number with an optional timeout.
338 # First lookup the host, and return undef if it is not found. Otherwise
345 $host, # Name or IP number of host to ping
348 my ($ip, # Packed IP number of $host
353 croak("Usage: \$p->ping(\$host [, \$timeout])") unless @_ == 2 || @_ == 3;
357 $ip = inet_aton($host);
358 return () unless defined($ip); # Does host exist?
378 $ret = $self->ping_syn($host, $ip, $ping_time, $ping_time+$timeout);
389 $ip, # Packed IP number of the host
408 $ip, # Packed IP number of the host
528 # host specific, we have to open and close each connection here. We
534 # enough of the reachability of the remote host. Also, tcp is
540 $ip, # Packed IP number of the host
559 $ip, # Packed IP number of the host
625 # Connection established to remote host
628 # TCP ACK will never come from this host
655 # Connection established to remote host
815 $ip, # Packed IP number of the host
836 $host, # Host or IP address
840 my ($ip); # Packed IP number of the host
841 $ip = inet_aton($host);
865 $ip, # Packed IP number of the host
879 $from_msg, # Characters echoed by $host
947 # For example an unreachable host will make recv() fail.
993 # Description: Send a TCP SYN packet to host specified.
997 my $host = shift;
1003 return $self->ping_syn_fork($host, $ip, $start_time, $stop_time);
1045 $self->{"bad"}->{$host} = $!;
1049 my $entry = [ $host, $ip, $fh, $start_time, $stop_time ];
1060 my ($self, $host, $ip, $start_time, $stop_time) = @_;
1069 my $entry = [ $host, $ip, $pid, $start_time, $stop_time ];
1115 # Description: Wait for TCP ACK from host specified
1116 # from ping_syn above. If no host is specified, wait
1129 if (my $host = shift) {
1131 if (exists $self->{"bad"}->{$host}) {
1133 $self->{"bad"}->{ $host } &&
1135 $self->{"bad"}->{ $host } eq "$!") {
1146 if ($entry->[0] eq $host) {
1149 || croak("Corrupted SYN entry for [$host]");
1153 croak("ack called on [$host] without calling ping first!")
1157 # No $host passed so scan all hosts
1211 # Connection established to remote host
1214 # TCP ACK will never come from this host
1264 my ($self,$host) = @_;
1266 if ($host) {
1268 if (my $entry = $self->{"good"}->{$host}) {
1269 delete $self->{"good"}->{$host};
1302 # Connection attempt to remote host is done
1307 if ($host && $entry->[0] ne $host) {
1308 # A good connection, but not the host we need.
1347 my $host = shift || croak('Usage> nack($failed_ack_host)');
1348 return $self->{"bad"}->{$host} || undef;
1372 Net::Ping - check a remote host for reachability
1379 print "$host is alive.\n" if $p->ping($host);
1384 foreach $host (@host_array)
1386 print "$host is ";
1387 print "NOT " unless $p->ping($host, 2);
1398 print "$host not reachable ", scalar(localtime()), "\n"
1399 unless $p->ping($host);
1407 foreach $host (@host_array) {
1408 $p->ping($host);
1410 while (($host,$rtt,$ip) = $p->ack) {
1411 print "HOST: $host [$ip] ACKed in $rtt seconds.\n";
1417 ($ret, $duration, $ip) = $p->ping($host, 5.5);
1418 printf("$host [ip: $ip] is alive (packet return time: %.2f ms)\n", 1000 * $duration)
1423 print "$host is alive.\n" if pingecho($host);
1433 ping. The "tcp" protocol is the default. Note that a live remote host
1438 connection to the remote host's echo port. If the connection is
1439 successfully established, the remote host is considered reachable. No
1444 packet to the remote host's echo port. If the echoed packet is
1445 received from the remote host and the received packet contains the
1446 same data as the packet that was sent, the remote host is considered
1448 It should be borne in mind that, for a udp ping, a host
1454 echo message to the remote host, which is what the UNIX ping program
1455 does. If the echoed message is received from the remote host and
1456 the echoed information is correct, the remote host is considered
1461 use the C<Net::Ping::External> module to ping the remote host.
1468 send a TCP SYN packet to the remote host then immediately return.
1471 the return value does NOT determine if the remote host is alive or
1473 yet. The remote host is only considered reachable if it receives
1478 SYN packets. It will not block while testing each remote host.
1499 are included in the ping packet sent to the remote host. The number of
1511 =item $p->ping($host [, $timeout]);
1513 Ping the remote host and wait for a response. $host can be either the
1514 hostname or the IP number of the remote host. The optional timeout
1519 be 1 if the host is reachable and 0 if it is not. For most practical
1522 host resolved to are also returned. The elapsed time value will
1574 the address of one of the interfaces on the local host. $local_addr
1585 =item $p->open($host);
1596 =item $p->ack( [ $host ] );
1599 the reachability of the remote host. This method is meant
1601 call returns the host (as passed to ping()) that came back
1606 host is not listening on the port attempted, then the TCP
1608 undef. In list context, the host, the ack time, and the
1609 dotted ip string will be returned instead of just the host.
1610 If the optional $host argument is specified, the return
1611 value will be partaining to that host only.
1617 The reason that host $failed_ack_host did not receive a
1628 =item pingecho($host [, $timeout]);
1654 longer to receive an echo packet from the remote host. If the timeout
1656 host is not reachable (which is almost the truth).
1658 Reachability doesn't necessarily mean that the remote host is actually