Here is a URL
http://192.168.1.2:1218/?name=verify_code_string_queue&opt=get&auth=verify_code_string_queue
It will return a string or a status code like SQS_GET_END
Now I need to break the loop when the url return a string,or keep blocking.
Here is my code
require 'net/http'
require 'open-uri'
loop do
codeText = open("http://192.168.1.2:1218/?name=verify_code_string_queue&opt=get&auth=verify_code_string_queue") do |repo|
repo.read
end
if codeText != "SQS_GET_END"
break
end
end
But it doesn't work,output cannot assign requested address - connect(2) (Errno::EADDRNOTAVAIL). Please tell me how to solve it,thanks