M
Mark Probert
Hi, rubyists.
I am trying to telnet to a large number of boxes. I have created a
wrapper around the net/telnet. One of the methods is called 'alive?'
that checks to see if the node can be reached prior to running up the
Telnet.
def alive?
begin
t = TCPSocket.new(@host,@port) # line= ./bsn.rb:83
t.close
return true
rescue => e
@exception = e
return false
end
end
When I run the this as part of a bigger program I get the following
exceptions raised all pointing to the TCPSocket.new call:
Exception `Errno::ETIMEDOUT' at ./bsn.rb:83 - Connection timed out -
connect(2)
Exception `Errno::ENETUNREACH' at ./bsn.rb:83 - Network is unreachable -
connect(2)
Exception `Errno::ENETUNREACH' at ./bsn.rb:83 - Network is unreachable -
connect(2)
Exception `Errno::ETIMEDOUT' at ./bsn.rb:83 - Connection timed out -
connect(2)
I am surprised that I am seeing these exceptions, given the open rescue
clause.
Any ideas?
I am trying to telnet to a large number of boxes. I have created a
wrapper around the net/telnet. One of the methods is called 'alive?'
that checks to see if the node can be reached prior to running up the
Telnet.
def alive?
begin
t = TCPSocket.new(@host,@port) # line= ./bsn.rb:83
t.close
return true
rescue => e
@exception = e
return false
end
end
When I run the this as part of a bigger program I get the following
exceptions raised all pointing to the TCPSocket.new call:
Exception `Errno::ETIMEDOUT' at ./bsn.rb:83 - Connection timed out -
connect(2)
Exception `Errno::ENETUNREACH' at ./bsn.rb:83 - Network is unreachable -
connect(2)
Exception `Errno::ENETUNREACH' at ./bsn.rb:83 - Network is unreachable -
connect(2)
Exception `Errno::ETIMEDOUT' at ./bsn.rb:83 - Connection timed out -
connect(2)
I am surprised that I am seeing these exceptions, given the open rescue
clause.
Any ideas?