lib/ztk/tcp_socket_check.rb in ztk-0.0.16 vs lib/ztk/tcp_socket_check.rb in ztk-0.0.17
- old
+ new
@@ -124,10 +124,10 @@
else
log(:debug) { "write(#{@config.host}:#{@config.port}, '#{@config.data}')" }
((IO.select(nil, [socket], nil, @config.timeout) && socket.write(@config.data)) ? true : false)
end
- rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
+ rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EHOSTUNREACH => e
log(:debug) { "#{@config.host}:#{@config.port} - #{e.message}" }
false
ensure
(socket && socket.close)
end