Codota Logo
WebSocketFrame.retain
Code IndexAdd Codota to your IDE (free)

How to use
retain
method
in
io.netty.handler.codec.http.websocketx.WebSocketFrame

Best Java code snippets using io.netty.handler.codec.http.websocketx.WebSocketFrame.retain (Showing top 20 results out of 333)

  • Common ways to obtain WebSocketFrame
private void myMethod () {
WebSocketFrame w =
  • Codota IconByteBuf binaryData;new TextWebSocketFrame(binaryData)
  • Codota IconByteBuf binaryData;new BinaryWebSocketFrame(binaryData)
  • Codota Iconnew CloseWebSocketFrame()
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

@Override
public PongWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public CloseWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public PingWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public BinaryWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: wildfly/wildfly

@Override
public ContinuationWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public TextWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public BinaryWebSocketFrame retain() {
  super.retain();
  return this;
}
origin: wildfly/wildfly

@Override
public ContinuationWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: wildfly/wildfly

@Override
public PongWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: wildfly/wildfly

@Override
public CloseWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: wildfly/wildfly

@Override
public PingWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: wildfly/wildfly

@Override
public TextWebSocketFrame retain(int increment) {
  super.retain(increment);
  return this;
}
origin: AsyncHttpClient/async-http-client

public void bufferFrame(WebSocketFrame frame) {
 if (bufferedFrames == null) {
  bufferedFrames = new ArrayList<>(1);
 }
 frame.retain();
 bufferedFrames.add(frame);
}
origin: wildfly/wildfly

@Override
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception {
  if (frame instanceof PingWebSocketFrame) {
    frame.content().retain();
    ctx.channel().writeAndFlush(new PongWebSocketFrame(frame.content()));
    return;
  }
  if (frame instanceof PongWebSocketFrame && dropPongFrames) {
    return;
  }
  out.add(frame.retain());
}
origin: jamesdbloom/mockserver

private void handleWebSocketFrame(final ChannelHandlerContext ctx, WebSocketFrame frame) {
  if (frame instanceof CloseWebSocketFrame) {
    handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
  } else if (frame instanceof TextWebSocketFrame) {
    webSocketClientRegistry.receivedTextWebSocketFrame(((TextWebSocketFrame) frame));
  } else if (frame instanceof PingWebSocketFrame) {
    ctx.write(new PongWebSocketFrame(frame.content().retain()));
  } else {
    throw new UnsupportedOperationException(String.format("%s frame types not supported", frame.getClass().getName()));
  }
}
origin: wildfly/wildfly

@Override
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception {
  if (frame instanceof CloseWebSocketFrame) {
    WebSocketServerHandshaker handshaker = getHandshaker(ctx.channel());
    if (handshaker != null) {
      frame.retain();
      handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame);
    } else {
      ctx.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
    }
    return;
  }
  super.decode(ctx, frame, out);
}
origin: jamesdbloom/mockserver

private void handleWebSocketFrame(final ChannelHandlerContext ctx, WebSocketFrame frame) throws JsonProcessingException {
  if (frame instanceof CloseWebSocketFrame) {
    handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain()).addListener(new ChannelFutureListener() {
      public void operationComplete(ChannelFuture future) {
        clientRegistry.remove(ctx);
      }
    });
  } else if (frame instanceof TextWebSocketFrame) {
    try {
      HttpRequest httpRequest = httpRequestSerializer.deserialize(((TextWebSocketFrame) frame).text());
      clientRegistry.put(ctx, httpRequest);
      sendUpdate(httpRequest, ctx);
    } catch (IllegalArgumentException iae) {
      sendMessage(ctx, ImmutableMap.<String, Object>of("error", iae.getMessage()));
    }
  } else if (frame instanceof PingWebSocketFrame) {
    ctx.write(new PongWebSocketFrame(frame.content().retain()));
  } else {
    throw new UnsupportedOperationException(String.format("%s frame types not supported", frame.getClass().getName()));
  }
}
origin: lets-blade/blade

/**
 * Only supported TextWebSocketFrame
 *
 * @param ctx
 * @param frame
 */
private void handleWebSocketFrame(ChannelHandlerContext ctx, WebSocketFrame frame) {
  if (frame instanceof CloseWebSocketFrame) {
    this.handler.onDisConnect(this.context);
    this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
    return;
  }
  if (frame instanceof PingWebSocketFrame) {
    ctx.channel().write(new PongWebSocketFrame(frame.content().retain()));
    return;
  }
  if (!(frame instanceof TextWebSocketFrame)) {
    throw new UnsupportedOperationException("unsupported frame type: " + frame.getClass().getName());
  }
  this.context.setReqText(((TextWebSocketFrame) frame).text());
  this.handler.onText(this.context);
}
origin: lets-blade/blade

/**
 * Only supported TextWebSocketFrame
 *
 * @param ctx
 * @param frame
 */
private void handleWebSocketFrame(ChannelHandlerContext ctx, WebSocketFrame frame) {
  if (frame instanceof CloseWebSocketFrame) {
    this.handler.onDisConnect(this.context);
    this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
    return;
  }
  if (frame instanceof PingWebSocketFrame) {
    ctx.channel().write(new PongWebSocketFrame(frame.content().retain()));
    return;
  }
  if (!(frame instanceof TextWebSocketFrame)) {
    throw new UnsupportedOperationException("unsupported frame type: " + frame.getClass().getName());
  }
  this.context.setReqText(((TextWebSocketFrame) frame).text());
  this.handler.onText(this.context);
}
origin: apache/tinkerpop

@Override
protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception {
  final Channel ch = ctx.channel();
  if (!handshaker.isHandshakeComplete()) {
    // web socket client connected
    handshaker.finishHandshake(ch, (FullHttpResponse) msg);
    handshakeFuture.setSuccess();
    return;
  }
  if (msg instanceof FullHttpResponse) {
    final FullHttpResponse response = (FullHttpResponse) msg;
    throw new Exception("Unexpected FullHttpResponse (getStatus=" + response.status() + ", content="
        + response.content().toString(CharsetUtil.UTF_8) + ')');
  }
  // a close frame doesn't mean much here.  errors raised from closed channels will mark the host as dead
  final WebSocketFrame frame = (WebSocketFrame) msg;
  if (frame instanceof TextWebSocketFrame) {
    ctx.fireChannelRead(frame.retain(2));
  } else if (frame instanceof PingWebSocketFrame) {
    ctx.writeAndFlush(new PongWebSocketFrame());
  }else if (frame instanceof PongWebSocketFrame) {
    logger.debug("Received response from keep-alive request");
  } else if (frame instanceof BinaryWebSocketFrame) {
    ctx.fireChannelRead(frame.retain(2));
  } else if (frame instanceof CloseWebSocketFrame)
    ch.close();
}
io.netty.handler.codec.http.websocketxWebSocketFrameretain

Popular methods of WebSocketFrame

  • content
  • isFinalFragment
    Flag to indicate if this frame is the final fragment in a message. The first fragment (frame) may al
  • copy
  • release
  • retainedDuplicate
  • rsv
    Bits used for extensions to the standard.
  • contentToString
  • duplicate
  • touch
  • getBinaryData
  • getRsv
  • getRsv

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • orElseThrow (Optional)
  • setContentView (Activity)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Collectors (java.util.stream)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now