Perform send terminate in thread to not block termination process
@@ -486,6 +486,9 @@ public class ChipGateway {
}
private ThreadTerminateException performProcessCancelled() {
+ Thread t = new Thread(new Runnable() {
+ @Override
+ public void run() {
try {
TerminateType resp = new TerminateType();
resp.setSessionIdentifier(sessionId);
@@ -493,6 +496,9 @@ public class ChipGateway {
sendMessage(getResource(terminateUrl), mapper.writeValueAsString(resp), CommandType.class);
} catch (JsonProcessingException | ConnectionError | InvalidRedirectUrlException | ChipGatewayDataError ex) {
}
+ }
+ }, "ChipGateway-terminate");
+ t.start();
return new ThreadTerminateException("ChipGateway protocol interrupted.");
}
