Libinfo call to to mDNS responder makes crashes ???

Hi,

I have a app that works great except the warning “Libinfo call to to mDNS responder on main thread”.
On some iPhone, the app launches but quits very fast. The only warning is the one above.

I am not sure of its meaning but it seems that when the app launches, I make a call to sync the app with a server.

Some people said that if the main thread is idle more than 10 seconds a “watch dog” will kill the app.

Here’s my question :

1/ Does this warning would explain that crash ?
2/ How to launch a task outside the main thread ?

Thanks,

Frédéric [import]uid: 5578 topic_id: 27441 reply_id: 327441[/import]

Yes, watchdog will kill your app if you take too long.

mDNSResponder: Don’t know. See this: http://developer.anscamobile.com/forum/2012/03/08/game-crashes-iphone-had-reboot

You may not launch other tasks.

If your load is taking too long, break it up so you don’t load as much at the same time. Then load a little bit more on the next frame or timer callback.
[import]uid: 7563 topic_id: 27441 reply_id: 111545[/import]

ok, thanks.

Not sure to know how to do that…

If I had to manage the sync through enterFrame or timer, it should be a bit tricky !

The app (a magazine) should be updated before the reader can read it : so the best time to do that is at the launch of the app ?

Frédéric [import]uid: 5578 topic_id: 27441 reply_id: 111569[/import]

I’m thinking you might want to use the async download APIs to load so you don’t block. Then just draw a temporarily placeholder image spinning progress indicator to say you are loading. The goal is to not block the main loop.

[import]uid: 7563 topic_id: 27441 reply_id: 111576[/import]

Thanks.

You mean http://developer.anscamobile.com/reference/index/networkdownload ?

I used socket.http and ltn12 lib instead. This may be the problem.

[import]uid: 5578 topic_id: 27441 reply_id: 111637[/import]

Yes, I was thinking of those. But if you are using Luasocket, you will want to use non-blocking sockets. Programming in Lua 2nd Edition section 9.4 has an example of using coroutines and non-blocking sockets which you might be able to utilize. However, I am not familiar with socket.http and ltn12lib and know if those work with those techniques.
[import]uid: 7563 topic_id: 27441 reply_id: 111706[/import]