使用cocos2dx中http的网络框架 联网异常

CCHttpRequest* request = new CCHttpRequest();

/settings Property/
request->setUrl(str.c_str());
request->setTag(tag.c_str());

time_t t = time(0);
long tem = t;//当前时间
char timeL;
sprintf(timeL, "%ld",tem);
char name;
string tempMd5;
tempMd5.append(name);
string code= getMD5(tempMd5.c_str(), tempMd5.length());
std::vector<std::string> headers;
string xauth = "x-auth:";
string timestamp = "timestamp:";
xauth.append(code);
timestamp.append(timeL);
headers.push_back(xauth);
headers.push_back(timestamp);
request->setHeaders(headers);
CCLOG("%s,%s,%s",request->getUrl(),xauth.c_str(),timestamp.c_str());
request->setRequestType(CCHttpRequest::kHttpGet);
request->setResponseCallback(this, callfuncND_selector(LinkNewwork::onHttpRequestCompleted));

/Requesting server/
cocos2d::extension::CCHttpClient* httpClient=cocos2d::extension::CCHttpClient::getInstance();
httpClient->setTimeoutForConnect(TypeMaxNumber);//设置连接超时时间
httpClient->setTimeoutForRead(TypeMaxNumber);//设置发送超时时间
httpClient->send(request);
/Reclaim memory/
request->release();

以上是联网代码 有时候可以运行过去,有时候就直接卡死, 报错的地方是

star0 #warning:
获取
app
配置信息失败
:
未能连接到服务器。

Cocos2d: HttpRequest async thread semaphore error: Interrupted system call
libsystem_kernel.dylib`__pthread_kill:
0x39521348: mov r12, #0x148
0x3952134c: svc #0x80
0x39521350: blo 0x39521368 ; __pthread_kill + 32
0x39521354: ldr r12, ; __pthread_kill + 24
0x39521358: ldr r12,
0x3952135c: b 0x39521364 ; __pthread_kill + 28
0x39521360: .long 0x01ab6cc4 ; unknown opcode
0x39521364: bx r12
0x39521368: bx lr

请教给位大神, 这是有什么引起的呢? 谢谢回复

Interrupted system call
系统中断造成的,你是在真机调试?手机上是否有可以打断的操作出现?来电或者别的什么?

是的。 那就是网络状态极其糟糕的时候, 网络是连接的,但是却没信号的时候。 请问,我可以在什么地方避免碰到这种问题,而不至于直接闪退呢
cocos2dx 2.12
xcode 5.1
真机调试

这个原因,我猜是因为andorid的send函数,在网络中断的时候被调用,会触发系统的中断,导致程序崩掉,貌似CCHttpRequest没有提供一个方法来避免这个问题?

你可以看下CCHttpRequest的代码,在send函数调用的最后一个参数改为MSG_NOSIGNAL