Before this change the decorator ensured that for a specific WebSocket session only one thread at a time can send a message. Other threads attempting to send would have their messages buffered and each time that occurs, a check is also made to see if the buffer limit has been reached or the send time limit has been exceeded and if so the session is closed. This change adds further protection to ensure only one thread at a time can perform the session limit checks and attempt to close the session. Furthermore if the session has timed out and become unresponsive, attempts to close it may block yet another thread. Taking this into consideration this change also ensures that state associated with the session is cleaned first before an attempt is made to close the session. Issue: SPR-11450master
parent
299be08268
commit
ffac748f1c
5 changed files with 163 additions and 41 deletions
@ -0,0 +1,34 @@ |
||||
/* |
||||
* Copyright 2002-2014 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.web.socket.handler; |
||||
|
||||
/** |
||||
* Raised when a WebSocket session has exceeded limits it has been configured |
||||
* for, e.g. timeout, buffer size, etc. |
||||
* |
||||
* @author Rossen Stoyanchev |
||||
* @since 3.0.4 |
||||
*/ |
||||
@SuppressWarnings("serial") |
||||
public class SessionLimitExceededException extends RuntimeException { |
||||
|
||||
|
||||
public SessionLimitExceededException(String message) { |
||||
super(message); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue