What kind of connection for html5 online game?

We send the request as soon as you make the request.
There’s no real reason it would actually take 10 seconds, unless the request is huge (?), or the performance of the game is really low, so that it runs slowly. Or that the connection from the Android device is slow?

1 Like

I don’t think any one of these reasons cause the problem. game has just one background, one label and one animated object using go.animate which moves smooth and no lag or frame lost. connection is not slow too. very simple http request ( just ip and port, no additional query or data! ) let me do some more test on some more devices, maybe i can find more information to find the reason of the delay!

1 Like

What if you do the request from the browser on the phone?

it’s ok, it gives response in less than one second on browser of phone.

maybe you get angry but i have to be honest, that android test with 10 seconds delay to send request was on bluestacks( but that request from browser was on bluestacks browser too and that was ok )
I have added two gui buttons to send request and tested on three real android devices and it’s completely ok on real phones. however that delay is depends on bluestacks but it’s not good justification, because my unity game works well on bluestacks and all http request and websocket request works well and fast on bluestacks too, thats much bigger game with lot of requests and process. in other side the defold android game was completely ok on bluestack and no problem with game itself but just was http request sending delay.
it seems I have some problem with windows and defold http requests, I should find it, i need http requests on windows.
final results about my http request tests:

  • still it doesn’t work on windows anyway
  • on android build it works on bluestacks but sending request has about 10 seconds delay
  • on android real phone it’s completely ok

I have no idea what it could be unfortunately. Requests work for me in HTML5, macOS and Windows.

No idea why it is slow on Bluestacks, but good that it is fast on an actual device. That is what matters.

1 Like

We don’t build x86 architecture for Android.
Probably they use some kind of emulation in BlueStack for ARM architecture. This might be the reason for such issues.
Anyway, it’s better to test using a real device.

1 Like

can you build exe from that example you sent http from your windows to my server? if an exe build works on your windows but not works on my windows it means problem is from my windows and probably it’s firewall, then i can check it on some other windows of my friends pcs too.

I didn’t have any experience in Lua and Defold before, after watching 7 videos of David Chadwick and some simple tutorial I have started to test networks on Defold to see if they work well then i take more time to learn Defold and lua, so it’s expected to have problem. the fun thing is that after some test of http, tcp and websocket I wanted to make a gui button to send request on android but i didn’t know how to make simple button in Defold, I fucked learning process in Defold :grin:
anyway I’ll do more study and tests to find unsolved problem, Thanks for all your helps. Love You All

1 Like