Commit 966690c1 by NitefullWind

1.实现可配置网络读写超时时间 2.更换图标

parent 65d8ad3b
No preview for this file type
No preview for this file type
......@@ -244,7 +244,7 @@ bool Setting::doRequest(const QByteArray &reqData, QByteArray &rspData)
int sendDataLen = reqData.length();
// 如果需要,加上消息头
if(Instance()->settingObj["NeedSocketHeader"].toBool()) {
if(Instance()->settingObj["NeedSocketHeader"].toBool() || true) {
char *sendDataWithHeader = new char[sendDataLen + sizeof(FMSOCKHEADER)];
FMSOCKHEADER header = { 0, 0, 0 };
header.flag = 0x4d46;
......@@ -259,12 +259,12 @@ bool Setting::doRequest(const QByteArray &reqData, QByteArray &rspData)
socket.write(sendData, sendDataLen);
}
if(!socket.waitForBytesWritten(10 * 1000)) {
if(!socket.waitForBytesWritten()) {
Instance()->setErrorString(QString("Write data failed. ").arg(socket.errorString()));
socket.close();
return false;
}
if(!socket.waitForReadyRead()) {
if(!socket.waitForReadyRead(1000*Instance()->settingObj["WaitReadTime"].toInt(120))) {
Instance()->setErrorString(QString("Read data failed.").arg(socket.errorString()));
socket.close();
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment