}
long endMS = System.currentTimeMillis();
+ long timeOutOffset = 0;
+
if (Options.doTest) {
- beginMS = beginMS + READ_TIMEOUT_TEST;
+ timeOutOffset = READ_TIMEOUT_TEST;
} else {
- beginMS = beginMS + READ_TIMEOUT;
+ timeOutOffset = READ_TIMEOUT;
}
- if (endMS > beginMS) {
- if (Options.doTest) {
- Log.err("Can not be read during 60 seconds.");
- } else {
- Log.err("Can not be read during 20 seconds.");
- }
+ if (endMS > (beginMS + timeOutOffset)) {
+ Log.err("Can not be read during 20 seconds(test case : 60 seconds).");
ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
throw new IMNetworkDownloadException(ErrorCode.INTERNET_CONNECTION_ERROR);
+ } else {
+ // normal operation. to do nothing.
}
}
} catch (SocketTimeoutException e) {
mConnection.setConnectTimeout(CONNECT_TIMEOUT);
mConnection.setReadTimeout(READ_TIMEOUT);
}
+// mConnection.setConnectTimeout(CONNECT_TIMEOUT);
+// mConnection.setReadTimeout(READ_TIMEOUT);
if (rangeSize > 0) {
setRangeRequest();