List of usage examples for org.springframework.web.socket.sockjs SockJsTransportFailureException SockJsTransportFailureException
public SockJsTransportFailureException(String message, String sessionId, @Nullable Throwable cause)
From source file:org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.java
/** * For internal use within a TransportHandler and the (TransportHandler-specific) * session class./*w w w . j a v a 2 s .c o m*/ */ protected void writeFrame(SockJsFrame frame) throws SockJsTransportFailureException { if (logger.isTraceEnabled()) { logger.trace("Preparing to write " + frame); } try { writeFrameInternal(frame); } catch (Throwable ex) { logWriteFrameFailure(ex); try { // Force disconnect (so we won't try to send close frame) disconnect(CloseStatus.SERVER_ERROR); } catch (Throwable disconnectFailure) { // Ignore } try { close(CloseStatus.SERVER_ERROR); } catch (Throwable closeFailure) { // Nothing of consequence, already forced disconnect } throw new SockJsTransportFailureException("Failed to write " + frame, getId(), ex); } }