简体   繁体   中英

GetToString works on Roku Express but not on Roku Ultra

On a Roku Express device the following code reliably and quickly gets the contents of a small (<100 bytes but never 'blank') text file whose content may change frequently; the code is run multiple times per minute.

  url="http://<-webpage-address->info.txt"
  timeout=1000
  fileString=""
  http = CreateObject("roUrlTransfer")
  http.SetPort(CreateObject("roMessagePort"))
  http.SetUrl(url)
  if http.AsyncGetToString()
    event = wait(timeout, http.GetPort())
    if type(event) = "roUrlEvent" then
      fileString = event.GetString()
    end if
  end if
  http.AsyncCancel()

On a Roku Express a non blank return (the contents of the info.txt file) happens virtually every time the code runs. On the other hand, a Roku Ultra almost always returns a blank string ""; it could take one or more typically hundreds of calls (sometimes never) to get a non-blank string return.

I have tried varying the timeout, using the non-asyncronous .GetToString() with its own timeout (~30 sec), appending to the url the likes of '?rnd=xxxx' where xxxx is a random number, and EnableFreshConnection(true) - all of which had no effect on success for the Ultra device.

My roku specifics: 3910RW Roku Express, software 10.0.0 build 4209-51 4670X Roku Ultra, softwate 10.0.0 build 4209-46

Why does this work consistently well on the Express but almost always fail on the Ultra? More importantly, how can I make this work reliably on an Ultra device?

After calls to both my webpage provider GoDaddy and my ISP provider Frontier it turns out a setting on my new Frontier-supplied NVG443B modem was the cause. Why some browsing devices and some Rokus could get fresh copies of the needed web page while other devices could not is not clear to me but technical phone support at Frontier resolved it (for now at least enabling IPv6 seems to be the solution).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM