Search in sources :

Example 1 with Type

use of org.eclipse.jetty.websocket.api.extensions.Frame.Type in project jetty.project by eclipse.

the class BlockheadServerConnection method incomingFrame.

@Override
public void incomingFrame(Frame frame) {
    LOG.debug("incoming({})", frame);
    int count = parseCount.incrementAndGet();
    if ((count % 10) == 0) {
        LOG.info("Server parsed {} frames", count);
    }
    incomingFrames.incomingFrame(WebSocketFrame.copy(frame));
    if (frame.getOpCode() == OpCode.CLOSE) {
        CloseInfo close = new CloseInfo(frame);
        LOG.debug("Close frame: {}", close);
    }
    Type type = frame.getType();
    if (echoing.get() && (type.isData() || type.isContinuation())) {
        try {
            write(WebSocketFrame.copy(frame).setMasked(false));
        } catch (IOException e) {
            LOG.warn(e);
        }
    }
}
Also used : Type(org.eclipse.jetty.websocket.api.extensions.Frame.Type) IOException(java.io.IOException) CloseInfo(org.eclipse.jetty.websocket.common.CloseInfo)

Aggregations

IOException (java.io.IOException)1 Type (org.eclipse.jetty.websocket.api.extensions.Frame.Type)1 CloseInfo (org.eclipse.jetty.websocket.common.CloseInfo)1