Class: Nonnative::Port
- Inherits:
-
Object
- Object
- Nonnative::Port
- Defined in:
- lib/nonnative/port.rb
Instance Method Summary collapse
- #closed? ⇒ Boolean
-
#initialize(process) ⇒ Port
constructor
A new instance of Port.
- #open? ⇒ Boolean
Constructor Details
Instance Method Details
#closed? ⇒ Boolean
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nonnative/port.rb', line 20 def closed? timeout.perform do open_socket raise Nonnative::Error rescue Nonnative::Error sleep_interval retry rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNRESET true end end |
#open? ⇒ Boolean
10 11 12 13 14 15 16 17 18 |
# File 'lib/nonnative/port.rb', line 10 def open? timeout.perform do open_socket true rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH sleep_interval retry end end |