while (reqHdl.getLastExchange() == null) {
QAUtil.sleep(100);
}
final AtomicBoolean isAllDataSend = new AtomicBoolean();
final IHttpExchange serverExchange = reqHdl.getLastExchange();
System.out.println("[" + (System.currentTimeMillis() - startTime) + "] server: suspend receiving");
serverExchange.getConnection().suspendReceiving();
Runnable resumeTask = new Runnable() {
public void run() {
QAUtil.sleep(1500);
if (isAllDataSend.get()) {
isErrorOccured.set(true);
}
try {
System.out.println("[" + (System.currentTimeMillis() - startTime) + "] server: resume receving");
serverExchange.getConnection().resumeReceiving();
} catch(IOException ioe) {
throw new RuntimeException(ioe);
}
}
};