@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(status.getCode(), status.getReason()); }
@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(new CloseReason(CloseCodes.getCloseCode(status.getCode()), status.getReason())); }
if (isActive() && !CloseStatus.SESSION_NOT_RELIABLE.equals(status)) { try { writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason()));
@Test public void closeWhenNotOpen() throws Exception { assertNew(); this.session.close(); assertNull("Close not ignored for a new session", this.session.getCloseStatus()); this.session.delegateConnectionEstablished(); assertOpen(); this.session.close(); assertClosed(); assertEquals(3000, this.session.getCloseStatus().getCode()); this.session.close(CloseStatus.SERVER_ERROR); assertEquals("Close should be ignored if already closed", 3000, this.session.getCloseStatus().getCode()); }
private IIdType bindSimple(WebSocketSession theSession, String theBindString) { IdType id = new IdType(theBindString); if (!id.hasIdPart() || !id.isIdPartValid()) { try { String message = "Invalid bind request - No ID included"; ourLog.warn(message); theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), message)); } catch (IOException e) { handleFailure(e); } return null; } if (id.hasResourceType() == false) { id = id.withResourceType("Subscription"); } try { ActiveSubscription activeSubscription = mySubscriptionRegistry.get(id.getIdPart()); myState = new BoundStaticSubscipriptionState( theSession, activeSubscription); } catch (ResourceNotFoundException e) { try { String message = "Invalid bind request - Unknown subscription: " + id.getValue(); ourLog.warn(message); theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), message)); } catch (IOException e1) { handleFailure(e); } return null; } return id; }
@Override public void closeNativeSession(String reason) { try { wsSession.close(new CloseStatus(CloseStatus.NORMAL.getCode(), reason)); } catch (IOException e) { log.warn("Exception closing webSocket session", e); } }
@Override public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { log.info("Road: {}, stream: {}, sessionId: {} - Connection closed - code: {}, reason: {}", roadName, streamName, sessionId, status.getCode(), status.getReason()); disposable.dispose(); }
@Override public void closeNativeSession(String reason) { try { wsSession.close(new CloseStatus(CloseStatus.NORMAL.getCode(), reason)); } catch (IOException e) { log.warn("Exception closing webSocket session", e); } }
@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(status.getCode(), status.getReason()); }
@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(status.getCode(), status.getReason()); }
"{} WebSocket session {} with transportId {} closed for {} (code {}, reason '{}')", label, session.getSessionId(), wsSession.getId(), CloseStatusHelper.getCloseStatusType(status.getCode()), status.getCode(), status.getReason()); "{} WebSocket session not associated to any jsonRpcSession " + "with transportId {} closed for {} (code {}, reason '{}')", label, wsSession.getId(), CloseStatusHelper.getCloseStatusType(status.getCode()), status.getCode(), status.getReason());
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception { logger.debug("Closing the session: " + session.getId()); jettyHandler.onClose(closeStatus.getCode(), "Closing Connection"); session.close(closeStatus);
"{} WebSocket session {} with transportId {} closed for {} (code {}, reason '{}')", label, session.getSessionId(), wsSession.getId(), CloseStatusHelper.getCloseStatusType(status.getCode()), status.getCode(), status.getReason()); "{} WebSocket session not associated to any jsonRpcSession " + "with transportId {} closed for {} (code {}, reason '{}')", label, wsSession.getId(), CloseStatusHelper.getCloseStatusType(status.getCode()), status.getCode(), status.getReason());
@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(new CloseReason(CloseCodes.getCloseCode(status.getCode()), status.getReason())); }
@Override protected void closeInternal(CloseStatus status) throws IOException { getNativeSession().close(new CloseReason(CloseCodes.getCloseCode(status.getCode()), status.getReason())); }
if (isActive() && !CloseStatus.SESSION_NOT_RELIABLE.equals(status)) { try { writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason()));
if (isActive() && !CloseStatus.SESSION_NOT_RELIABLE.equals(status)) { try { writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason()));