Close session on error
This commit is contained in:
parent
8c45bf972e
commit
85c754865e
@ -180,13 +180,20 @@ public final class EdgeGrpcSession implements Closeable {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(Throwable t) {
|
public void onError(Throwable t) {
|
||||||
log.error("Failed to deliver message from client!", t);
|
log.error("Failed to deliver message from client!", t);
|
||||||
|
closeSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCompleted() {
|
public void onCompleted() {
|
||||||
|
closeSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeSession() {
|
||||||
connected = false;
|
connected = false;
|
||||||
if (edge != null) {
|
if (edge != null) {
|
||||||
sessionCloseListener.accept(edge.getId());
|
try {
|
||||||
|
sessionCloseListener.accept(edge.getId());
|
||||||
|
} catch (Exception ignored) {}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
outputStream.onCompleted();
|
outputStream.onCompleted();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user