URLはこちら
http://192.168.1.2:1218/?name=verify_code_string_queue&opt=get&auth=verify_code_string_queue
文字列または SQS_GET_END のようなステータス コードを返します。
URL が文字列を返すとき、またはブロックし続けるときに、ループを中断する必要があります。
これが私のコードです
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
しかし、それは機能しません。出力は要求されたアドレスを割り当てることができません - connect(2) (Errno::EADDRNOTAVAIL)。解決方法を教えてください、よろしくお願いします