org.apache.tomcat.websocket.WsIOException Java Examples

The following examples show how to use org.apache.tomcat.websocket.WsIOException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WsFrameServer.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
protected void sendMessageText(boolean last) throws WsIOException {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(applicationClassLoader);
        super.sendMessageText(last);
    } finally {
        Thread.currentThread().setContextClassLoader(cl);
    }
}
 
Example #2
Source File: WsFrameServer.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
protected void sendMessageBinary(ByteBuffer msg, boolean last) throws WsIOException {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(applicationClassLoader);
        super.sendMessageBinary(msg, last);
    } finally {
        Thread.currentThread().setContextClassLoader(cl);
    }
}
 
Example #3
Source File: WsHttpUpgradeHandler.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public void onDataAvailable() {
    try {
        wsFrame.onDataAvailable();
    } catch (WsIOException ws) {
        wsProtocolHandler.close(ws.getCloseReason());
    } catch (IOException ioe) {
        onError(ioe);
        CloseReason cr = new CloseReason(
                CloseCodes.CLOSED_ABNORMALLY, ioe.getMessage());
        wsProtocolHandler.close(cr);
    }
}