Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

Re: Check Network Connection before connecting Alert Box hel

I was thinking something along the lines of

xfer = CreateObject("roUrlTransfer")
xfer.setURL("http://360abyss.com/")
if xfer.getToString() = "" then
' do something, like diagnostic popup that server cannot be contacted
end if

Above i trust that when failing a fetch, .getToString() returns empty string regardless of reason. Alternatively, one can

'accept only HTTP 200 OK
if xfer.getToFile("tmp:/junk") <> 200

'or check if the content contains a desired substring (in this case "360abyss.com" is inside many href='s)
if xfer.getToString().inStr(0, "360abyss.com") < 0 then
0 Kudos
donavonc
Visitor

Re: Check Network Connection before connecting Alert Box hel

Thanks everyone . it worked. 🙂
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.