Skip to content

Commit c95c4dc

Browse files
committed
Avoid blocking when closing channels.
1 parent 56125c5 commit c95c4dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Dirmi/src/main/java/org/cojen/dirmi/core/StandardSession.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,11 @@ private void close(SessionCloseListener.Cause cause, String message, Throwable e
678678
}
679679

680680
for (InvocationChan chan : toDiscard) {
681-
chan.discard();
681+
if (cause == SessionCloseListener.Cause.LOCAL_CLOSE) {
682+
chan.discard();
683+
} else {
684+
chan.disconnect();
685+
}
682686
}
683687
}
684688
} finally {

0 commit comments

Comments
 (0)