Example usage for io.netty.handler.codec.http.websocketx WebSocketFrame duplicate

List of usage examples for io.netty.handler.codec.http.websocketx WebSocketFrame duplicate

Introduction

In this page you can find the example usage for io.netty.handler.codec.http.websocketx WebSocketFrame duplicate.

Prototype

@Override
    public WebSocketFrame duplicate() 

Source Link

Usage

From source file:org.wso2.carbon.inbound.endpoint.protocol.websocket.management.WebsocketSubscriberPathManager.java

License:Open Source License

public void broadcastOnSubscriberPath(WebSocketFrame frame, String inboundName, String subscriberPath) {
    List<InboundWebsocketChannelContext> contextList = getSubscriberPathChannelContextList(inboundName,
            subscriberPath);//from  w ww  . j  av  a  2s. c o m
    for (InboundWebsocketChannelContext context : contextList) {
        WebSocketFrame duplicatedFrame = frame.duplicate();
        context.writeToChannel(duplicatedFrame);
    }
}

From source file:org.wso2.carbon.inbound.endpoint.protocol.websocket.management.WebsocketSubscriberPathManager.java

License:Open Source License

public void exclusiveBroadcastOnSubscriberPath(WebSocketFrame frame, String inboundName, String subscriberPath,
        InboundWebsocketChannelContext ctx) {
    List<InboundWebsocketChannelContext> contextList = getSubscriberPathChannelContextList(inboundName,
            subscriberPath);//ww  w  .j ava 2 s . c om
    for (InboundWebsocketChannelContext context : contextList) {
        if (!context.getChannelIdentifier().equals(ctx.getChannelIdentifier())) {
            WebSocketFrame duplicatedFrame = frame.duplicate();
            context.writeToChannel(duplicatedFrame);
        }
    }
}