lib/multi_process/process/rails.rb in multi_process-1.0.0 vs lib/multi_process/process/rails.rb in multi_process-1.1.0
- old
+ new
@@ -42,11 +42,11 @@
end
def available?
fail ArgumentError.new "Cannot check availability for port #{port}." if port == 0
- TCPSocket.new('127.0.0.1', port).close
+ TCPSocket.new('localhost', port).close
true
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
false
end
@@ -65,10 +65,10 @@
private
def free_port
socket = Socket.new(:INET, :STREAM, 0)
- socket.bind(Addrinfo.tcp('127.0.0.1', 0))
+ socket.bind(Addrinfo.tcp('localhost', 0))
socket.local_address.ip_port
ensure
socket.close if socket
end
end