Search in sources :

Example 1 with CloseStatus

use of org.springframework.web.reactive.socket.CloseStatus in project spring-framework by spring-projects.

the class AbstractListenerWebSocketSession method onError.

@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()));
}
Also used : CloseStatus(org.springframework.web.reactive.socket.CloseStatus)

Example 2 with CloseStatus

use of org.springframework.web.reactive.socket.CloseStatus in project spring-framework by spring-projects.

the class StandardWebSocketHandlerAdapter method onClose.

@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()));
    }
}
Also used : CloseStatus(org.springframework.web.reactive.socket.CloseStatus) Endpoint(javax.websocket.Endpoint)

Example 3 with CloseStatus

use of org.springframework.web.reactive.socket.CloseStatus in project spring-framework by spring-projects.

the class UndertowWebSocketHandlerAdapter method onFullCloseMessage.

@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();
}
Also used : CloseMessage(io.undertow.websockets.core.CloseMessage) CloseStatus(org.springframework.web.reactive.socket.CloseStatus)

Aggregations

CloseStatus (org.springframework.web.reactive.socket.CloseStatus)3 CloseMessage (io.undertow.websockets.core.CloseMessage)1 Endpoint (javax.websocket.Endpoint)1