Corona SDK and Lua Socket blocks animation -
here network handler: https://gist.github.com/anonymous/22fc110ad126ef3a2c5f
the problem when data received blocks animiation (i have wheel spinning when data has been requested) looks app have crashed , after 1 second or 2, when data has been received, works charm.
this line seems make sure when waiting answer app doesn't freeze:
local input,output = socket.select( { self.sock }, nil, 0 ) -- way not block runtime while reading socket. 0 timeout trick here timeout setting:
self.sock:settimeout(0) i have tried change them 0.01 , 0.001 no luck. i'm not sure how make animation doesn't freeze.
maybe should change 1 of coronas built in async network handler (with callback functions) or possible modify network handler animation doesn't freeze?
if can use corona's network.* api, it's async won't have blocking calls.
documentation link: http://docs.coronalabs.com/daily/api/library/network/index.html
Comments
Post a Comment