Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Feature request: return partial results while urlloader downloads are in progress — Gideros Forum

Feature request: return partial results while urlloader downloads are in progress

ndossndoss Guru
edited April 2012 in Suggestions & requests
We're loading a url that frequently doesn't fully complete, but it does load enough data for our purposes (it almost always returns ~60K out of ~62K bytes, but rarely returns the full amount). I'm not sure whether it's a problem with the website or with UrlLoader.
local function onProgress(event)
   print(event.bytesLoaded .. " of " .. event.bytesTotal .. " bytes loaded")
end
local loader = UrlLoader.new("<a href="http://east.cherryhill.k12.nj.us&quot" rel="nofollow">http://east.cherryhill.k12.nj.us&quot</a><img class="emoji" src="https://forum.gideros.rocks/resources/emoji/wink.png" title=";)" alt=";)" height="20" />
loader:addEventListener(Event.PROGRESS, onProgress)
One fix for us would be for the progress event to also return the data loaded so far (e.g., in event.data). Would it be possible to add something like this?

Another question: Does UrlLoader have a default timeout? When we don't get all the results, we never seem to get an error.

Comments

  • URLLoader is meant as a simple tool. For your advanced needs luasocket (available in next version) will be needed, as it has everything you need.

    Likes: ndoss

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    edited April 2012
    @ndoss yes, I can add this feature.

    btw, I always get "63226 of 63226" on desktop player. Which platform did you try on? Because every platform (desktop, iOS and Android) has different implementation.

    Also can you add these lines:
    local function onComplete(event)
    	print("complete: "..#event.data)
    end
    loader:addEventListener(Event.COMPLETE, onComplete)
    and check the final length?

  • btw, I always get "63226 of 63226" on desktop player. Which platform did you try on? Because every platform (desktop, iOS and Android) has different implementation.
    Windows desktop player running under wine.

    Also can you add these lines:
    local function onComplete(event)
    	print("complete: "..#event.data)
    end
    loader:addEventListener(Event.COMPLETE, onComplete)
    and check the final length?
    I have callbacks for complete and error events but neither gets called when it doesn't fully load. I was thinking it might be a temporary problem with the server, but it's still failing to complete more often than not.
  • I made a short video to show you what I see ... it completes about 4 out of 10 times ...
  • atilimatilim Maintainer
    edited April 2012
    Hi ndoss,

    I see. At first, I suspected from wine and did some test with mint 12 + wine and couldn't catch any errors.

    If possible, can you download this program http://dl.dropbox.com/u/684866/urlloader.zip and run it? This and gideros desktop player use the same way to download urls. Output of this program can help me to understand what's going wrong. (after running you should click go once and wait a little)

    thank you
  • The windows binary doesn't always complete. I compiled a linux binary from the source code and it always completes.
  • atilimatilim Maintainer
    edited April 2012
    Hi ndoss,

    Thank you for testing it out. (I'm glad you already have Qt toolchain :) ) Then most probably it's a problem of wine. But I don't know why my wine works and yours doesn't. It may be a combination of your hardware, network and wine version. (btw, I'm using wine 1.3.28)
  • gorkemgorkem Maintainer
    I'm using Wine 1.2.2 and works (tried 6 times, finished 6 times).

  • Then most probably it's a problem of wine. But I don't know why my wine works and yours doesn't. It may be a combination of your hardware, network and wine version. (btw, I'm using wine 1.3.28)
    I'm wine 1.3.28 also (linux mint 12 & ethernet port on the motherboard). I pulled up wireshark and the whole message comes through even though urlloader doesn't complete. If I keep pressing "go" 7 or 8 times, urlloader stops sending any packets to the network.
    I'm glad you already have Qt toolchain
    My primary language in my real job is c++ w/ an occasional opportunity to use qt.

  • atilimatilim Maintainer
    edited April 2012
    It seems we cannot find a solution :-/
  • It seems we cannot find a solution :-/
    Thanks for giving it a shot ... thankfully we don't have to deploy our app on wine!

    Likes: atilim

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.