调整G300设备导出设备日志超时失败

This commit is contained in:
yangjiaxuan 2023-10-09 11:11:10 +08:00
parent f9b31130ac
commit 34d854cc56
1 changed files with 14 additions and 14 deletions

View File

@ -1263,21 +1263,21 @@ int hg_scanner_300::get_device_log(string &log)
}
str.resize(total);
str2.resize(total);
//ret = io_->read_bulk(&str[index], &block);//Reading too much data at once can cause error(TIME_OUT), it requires segmented reading. 2023-10-9
while (total)
{
block = 1024 * 1024;
if (total < block)
{
block = total;
}
ret = io_->read_bulk(&str[index], &block);
//while (ret == SCANNER_ERR_TIMEOUT) ///设备代ç <C3A7>是è¿è¡Œäº†ç¬¬äºŒæ¬?write æ<>¡ä»¶æ˜¯len > 0 å¦æžœå‡ºçŽ°é—®é¢˜è¿™ä¸ªåœ°æ¹éœ€è¦<C3A8>打开
//{
// block = 1024 * 1024;
// if (total < block)
// {
// block = total;
// }
// ret = io_->read_bulk(&str2[index], &block);
// //if (ret != SCANNER_ERR_OK)
// //return ret;
if (ret != SCANNER_ERR_OK)
return ret;
// index += block;
// total -= block;
//}
index += block;
total -= block;
}
}
if (ret != SCANNER_ERR_OK)