public static final int THREAD_SLEEP_INTERVAL = 100; // 100 ms interval for thread polling
/* timeout value */
- public static final int DATA_SOCKET_INTERRUPT_INTERVAL = 500; // 0.5 sec for interruption check
+ public static final int DATA_SOCKET_INTERRUPT_INTERVAL = 1000; // 1 sec for interruption check
public static final int DATA_SOCKET_TIMEOUT_NORMAL = 10000; // 10 second
public static final int DATA_SOCKET_TIMEOUT_TERMINATE = 3000; // 3 second
public static final int DATA_SOCKET_TIMEOUT_CLEAR = 10; // 10 ms
- public static final int CONTROL_SOCKET_TIMEOUT = 10000; // 10 second
+ public static final int CONTROL_SOCKET_TIMEOUT = 20000; // 20 second
public static final int PROC_ADD_INFO_TIMEOUT = 1000;
/* timer intervals */
private static boolean processInfoArrived = false;
private static boolean terminateMsgArrived = false; // set by message parser
private static boolean dataSocketClosed = false; // set by data channel thread
+ private static boolean stopAckArrived = false; // set by control channel
private static NewLeakDetector newLeakDetector = new NewLeakDetector();
private static WarningChecker warningChecker = new WarningChecker();
dataSocketClosed = closed;
}
+ public static boolean isStopAckArrived() {
+ return stopAckArrived;
+ }
+
+ public static void setStopAckArrived(boolean arrived) {
+ stopAckArrived = arrived;
+ }
+
public static NewLeakDetector getNewLeakDetector() {
return newLeakDetector;
}
public static void clear() {
processInfoArrived = false;
terminateMsgArrived = false;
+ stopAckArrived = false;
newLeakDetector.clear();
warningChecker.clear();
AckMessage result = parent.handleControlMessage(msg);
if (result != null && result.isSuccess()
&& result.isCorrectID(ProtocolConstant30.MSG_STOP_ACK)) {
+ AnalyzerManager.setStopAckArrived(true);
return new DAResult(ErrorCode.SUCCESS);
} else {
return new DAResult(ErrorCode.ERR_MSG_STOP_FAIL);
throw new InterruptedIOException();
}
+ // check if stop ack arrived
+ if (AnalyzerManager.isStopAckArrived()) {
+ throw new SocketTimeoutException();
+ }
+
// check the real timeout for socket
if (timeoutValue >= socketTimeout) {
throw e;
if (Global.getProject().getActiveProcessCount() == 0) {
// if there is no active process, no more message from target
AnalyzerManager.setTerminateMsgArrived(true);
- // exit data channel thread
- return true;
}
}
- return false;
+ // exit data channel thread only if ensure stop ack is arrived
+ // that means there is no more data to received by data channel
+ if (AnalyzerManager.isStopAckArrived()) {
+ return true;
+ } else {
+ return false;
+ }
}
private void notifyStopWork(final DAResult result, final boolean stopFromTarget) {