Class: OpenHAB::Core::Actions::Ping
- Inherits:
-
Object
- Object
- OpenHAB::Core::Actions::Ping
- Defined in:
- lib/openhab/core/actions/ping.rb
Overview
Class Method Summary collapse
-
.check_vitality(host, port = nil, timeout = nil) ⇒ true, false
Checks the vitality of host.
Class Method Details
.check_vitality(host, port = nil, timeout = nil) ⇒ true, false
Checks the vitality of host.
If port is nil
, a regular ping is issued. If other ports are
specified we try to open a new Socket with the given timeout.
20 21 22 23 24 25 |
# File 'lib/openhab/core/actions/ping.rb', line 20 def check_vitality(host, port = nil, timeout = nil) port ||= 0 timeout ||= 0 timeout = timeout.to_millis if timeout.is_a?(Duration) checkVitality(host, port, timeout) end |