W
Walle Wallen
I have a strange problem. The script posted at the end off this post is
not working properly on one of my computers. If I run it alone, it works
just fine, but not inside one of my scripts. The script works fine on
all other computers that I have tested. Do anyone now what could be
causing this.
//Walle
It raises the following exception:
"Exception `SocketError' at ./Handlers/ServerStatusHandler.rb:125 -
getaddrinfo: Name or service not known"'
The script:
def pingecho(host, timeout=5, service="echo")
begin
timeout(timeout) do
s = TCPSocket.new(host, service)
s.close
end
rescue Errno::ECONNREFUSED
return true
rescue Timeout::Error, StandardError
return false
end
return true
end
not working properly on one of my computers. If I run it alone, it works
just fine, but not inside one of my scripts. The script works fine on
all other computers that I have tested. Do anyone now what could be
causing this.
//Walle
It raises the following exception:
"Exception `SocketError' at ./Handlers/ServerStatusHandler.rb:125 -
getaddrinfo: Name or service not known"'
The script:
def pingecho(host, timeout=5, service="echo")
begin
timeout(timeout) do
s = TCPSocket.new(host, service)
s.close
end
rescue Errno::ECONNREFUSED
return true
rescue Timeout::Error, StandardError
return false
end
return true
end