/** * Create a new {@link CloseStatus} from this one with the specified reason. * @param reason the reason * @return a new {@link CloseStatus} instance */ public CloseStatus withReason(String reason) { Assert.hasText(reason, "Reason must not be empty"); return new CloseStatus(this.code, reason); }
@Override public void onError(Throwable ex) { if (this.completionMono != null) { this.completionMono.onError(ex); } int code = CloseStatus.SERVER_ERROR.getCode(); close(new CloseStatus(code, ex.getMessage())); }
@Override public void onError(Throwable ex) { if (this.completionMono != null) { this.completionMono.onError(ex); } int code = CloseStatus.SERVER_ERROR.getCode(); close(new CloseStatus(code, ex.getMessage())); }
@OnWebSocketClose public void onWebSocketClose(int statusCode, String reason) { if (this.delegateSession != null) { this.delegateSession.handleClose(new CloseStatus(statusCode, reason)); } }
@Override public void onClose(Session session, CloseReason reason) { if (this.delegateSession != null) { int code = reason.getCloseCode().getCode(); this.delegateSession.handleClose(new CloseStatus(code, reason.getReasonPhrase())); } }
@Override protected void onFullCloseMessage(WebSocketChannel channel, BufferedBinaryMessage message) { CloseMessage closeMessage = new CloseMessage(message.getData().getResource()); this.session.handleClose(new CloseStatus(closeMessage.getCode(), closeMessage.getReason())); message.getData().free(); }
/** * Create a new {@link CloseStatus} from this one with the specified reason. * @param reason the reason * @return a new {@link CloseStatus} instance */ public CloseStatus withReason(String reason) { Assert.hasText(reason, "Reason must not be empty"); return new CloseStatus(this.code, reason); }
@OnWebSocketClose public void onWebSocketClose(int statusCode, String reason) { if (this.delegateSession != null) { this.delegateSession.handleClose(new CloseStatus(statusCode, reason)); } }
@Override public void onClose(Session session, CloseReason reason) { if (this.delegateSession != null) { int code = reason.getCloseCode().getCode(); this.delegateSession.handleClose(new CloseStatus(code, reason.getReasonPhrase())); } }
@Override protected void onFullCloseMessage(WebSocketChannel channel, BufferedBinaryMessage message) { CloseMessage closeMessage = new CloseMessage(message.getData().getResource()); this.session.handleClose(new CloseStatus(closeMessage.getCode(), closeMessage.getReason())); message.getData().free(); }