Browse Source

Reset connection before delegating to handler

Resetting the connection first before invoking a failure callback on
the application handler ensures that any checks to isConnected will
return false.

Issue: SPR-14721
pull/1195/head
Rossen Stoyanchev 10 years ago
parent
commit
62b02c23ab
  1. 4
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java

4
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java

@ -456,8 +456,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession { @@ -456,8 +456,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
logger.debug("Connection closed session id=" + this.sessionId);
}
if (!this.closing) {
handleFailure(new ConnectionLostException("Connection closed"));
resetConnection();
handleFailure(new ConnectionLostException("Connection closed"));
}
}
@ -647,8 +647,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession { @@ -647,8 +647,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
if (logger.isDebugEnabled()) {
logger.debug(error);
}
handleFailure(new IllegalStateException(error));
resetConnection();
handleFailure(new IllegalStateException(error));
}
}

Loading…
Cancel
Save