Hi everyone,
I’m newbie in cocos2dx dev,i have a question about running thread in background, i have searched alot but i found nothing about it in cocos2dx.
I make a game have socket comunication with server (using libcurl), and make it work on a thread (i’m using pthread to make multithread). when device go to background mode , this thread was sleep too
In cocos2d-iphone i can use code below to keep it working in backgorund mode
UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
Any suggestion for me? thanks so much and sorry for my bad English