Class | Net::Ping::UDP |
In: |
lib/net/ping/udp.rb
|
Parent: | Ping |
data | [R] | The data to send to the remote host. By default this is ‘ping’. This should be MAX_DATA size characters or less. |
Returns whether or not the connect behavior should enforce remote service availability as well as reachability. The default is true.
Set whether or not the connect behavior should enforce remote service availability as well as reachability. If set to false then Errno::ECONNREFUSED or Errno::ECONNRESET will be considered a successful ping, meaning no actual data handshaking is required. By default, if either of those errors occurs it is considered a failed ping.
Associates the local end of the UDP connection with the given host and port. This is essentially a wrapper for UDPSocket#bind.
Sends a simple text string to the host and checks the return string. If the string sent and the string returned are a match then the ping was successful and true is returned. Otherwise, false is returned.