Sorry for my late reply…
Let me explain what am doing:
I have a Reachability class ,which will check for internet connection status.
I am calling its function from Appdelegate.cpp .
the function looks like :
*pRequest = new cocos2d::extension::CCHttpRequest;
string link1 = TEST_LINK;
>send;>scheduleSelector(schedule_selector(Reachability::checkForResponse), this, MAX_RESPONSE_TIME, 0, 0,false);
I have an onRequestCompleted() handler and a scheduled funtion checkForResponse().
if onRequestCompleted() is fired first, I am taking the connection as proper.
if in onRequestCompleted() , if response is null,it is no connection.
And if onRequestCompleted() is not fired within time interval MAX_RESPONSE_TIME , the sceduled function will be fired first and this case I am taking as slow connection
When it is proper connection, I am starting other downloads.
But my app crashes occasionally even if it returns proper connection.
is it the default timeout making problem here ?