From 100d52a7bf6887b2f8af2fc816041d09553c3617 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 23 Apr 2018 16:53:47 +0300 Subject: server: ConcurrentWebSocketSessionDecorator --- .../src/main/java/com/juick/components/Notifications.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'juick-notifications/src/main/java') diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java index 439c4bd7..9f62fd4d 100644 --- a/juick-notifications/src/main/java/com/juick/components/Notifications.java +++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java @@ -46,6 +46,7 @@ import org.springframework.web.socket.CloseStatus; import org.springframework.web.socket.PingMessage; import org.springframework.web.socket.TextMessage; import org.springframework.web.socket.WebSocketSession; +import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; import org.springframework.web.socket.handler.TextWebSocketHandler; import javax.annotation.Nonnull; @@ -261,13 +262,13 @@ public class Notifications extends TextWebSocketHandler implements NotificationC @Inject private ApplicationEventPublisher applicationEventPublisher; - private WebSocketSession session; + private ConcurrentWebSocketSessionDecorator session; private final AtomicBoolean closeFlag = new AtomicBoolean(false); @Override public void afterConnectionEstablished(WebSocketSession session) throws Exception { logger.info("WebSocket connected"); - this.session = session; + this.session = new ConcurrentWebSocketSessionDecorator(session, 60000, 65535); } @Override -- cgit v1.2.3