M
Mark Probert
Hi ..
I would like to suggest that Socket trap ETIMEDOUT and raise Timeout::Error
when a socket timeout occurs. This would allow the following:
begin
Timeout::timeout(to) do
t = TCPSocket.new(host,port)
#
# do socket stuff
#
t.close
end
rescue Timeout::Error => e
p "Timeout --> #{e}"
rescue Exception => e
p "Exception --> #{e}"
end
Rather than having a separate rescue clause.
Any thoughts?
I would like to suggest that Socket trap ETIMEDOUT and raise Timeout::Error
when a socket timeout occurs. This would allow the following:
begin
Timeout::timeout(to) do
t = TCPSocket.new(host,port)
#
# do socket stuff
#
t.close
end
rescue Timeout::Error => e
p "Timeout --> #{e}"
rescue Exception => e
p "Exception --> #{e}"
end
Rather than having a separate rescue clause.
Any thoughts?