Codota Logo
TextWebSocketFrame.<init>
Code IndexAdd Codota to your IDE (free)

How to use
io.netty.handler.codec.http.websocketx.TextWebSocketFrame
constructor

Best Java code snippets using io.netty.handler.codec.http.websocketx.TextWebSocketFrame.<init> (Showing top 20 results out of 864)

  • Common ways to obtain TextWebSocketFrame
private void myMethod () {
TextWebSocketFrame t =
  • Codota IconByteBuf binaryData;new TextWebSocketFrame(binaryData)
  • Codota IconString text;new TextWebSocketFrame(text)
  • Codota IconWebSocketFrame webSocketFrame;(TextWebSocketFrame) webSocketFrame.retainedDuplicate()
  • Smart code suggestions by Codota
}
origin: Netflix/zuul

@Override
public Object goAwayMessage() {
  return new TextWebSocketFrame("_CLOSE_");
}
origin: AsyncHttpClient/async-http-client

@Override
public Future<Void> sendTextFrame(String payload, boolean finalFragment, int rsv) {
 return channel.writeAndFlush(new TextWebSocketFrame(finalFragment, rsv, payload));
}
origin: Netflix/zuul

@Override
public ChannelFuture sendPushMessage(ChannelHandlerContext ctx, ByteBuf mesg) {
  final TextWebSocketFrame wsf = new TextWebSocketFrame(mesg);
  return ctx.channel().writeAndFlush(wsf);
}
origin: AsyncHttpClient/async-http-client

@Override
public Future<Void> sendTextFrame(ByteBuf payload, boolean finalFragment, int rsv) {
 return channel.writeAndFlush(new TextWebSocketFrame(finalFragment, rsv, payload));
}
origin: lets-blade/blade

public void message(String value) {
  ctx.writeAndFlush(new TextWebSocketFrame(value));
}
origin: lets-blade/blade

public void message(String value) {
  ctx.writeAndFlush(new TextWebSocketFrame(value));
}
origin: jamesdbloom/mockserver

private void sendMessage(ChannelHandlerContext ctx, ImmutableMap<String, Object> message) throws JsonProcessingException {
  ctx.channel().writeAndFlush(new TextWebSocketFrame(
    objectMapper.writeValueAsString(message)
  ));
}
origin: Netflix/zuul

@Override
public Object goAwayMessage() {
  return new TextWebSocketFrame("_CLOSE_");
}
origin: ballerina-platform/ballerina-lang

/**
 * Send text to the server.
 *
 * @param text text need to be sent.
 */
public void sendText(String text) {
  if (channel == null) {
    LOGGER.debug("Channel is null. Cannot send text.");
    throw new IllegalArgumentException("Cannot find the channel to write");
  }
  channel.writeAndFlush(new TextWebSocketFrame(text));
}
origin: mpusher/mpush

@Override
public Object toFrame(Channel channel) {
  byte[] json = Json.JSON.toJson(this).getBytes(Constants.UTF_8);
  return new TextWebSocketFrame(Unpooled.wrappedBuffer(json));
}
origin: jooby-project/jooby

@Override
public void sendText(final String data, final SuccessCallback success, final OnError err) {
 ctx.channel().writeAndFlush(new TextWebSocketFrame(data))
   .addListener(listener(success, err));
}
origin: jooby-project/jooby

@Override
public void sendText(final ByteBuffer data, final SuccessCallback success, final OnError err) {
 ByteBuf buffer = Unpooled.wrappedBuffer(data);
 ctx.channel().writeAndFlush(new TextWebSocketFrame(buffer))
   .addListener(listener(success, err));
}
origin: jooby-project/jooby

@Override
public void sendText(final byte[] data, final SuccessCallback success, final OnError err) {
 ByteBuf buffer = Unpooled.wrappedBuffer(data);
 ctx.channel().writeAndFlush(new TextWebSocketFrame(buffer))
   .addListener(listener(success, err));
}
origin: Netflix/zuul

@Override
public ChannelFuture sendPushMessage(ChannelHandlerContext ctx, ByteBuf mesg) {
  final TextWebSocketFrame wsf = new TextWebSocketFrame(mesg);
  return ctx.channel().writeAndFlush(wsf);
}
origin: wildfly/wildfly

@Override
public TextWebSocketFrame replace(ByteBuf content) {
  return new TextWebSocketFrame(isFinalFragment(), rsv(), content);
}
origin: wildfly/wildfly

  @Override
  protected WebSocketFrame beginAggregation(WebSocketFrame start, ByteBuf content) throws Exception {
    if (start instanceof TextWebSocketFrame) {
      return new TextWebSocketFrame(true, start.rsv(), content);
    }

    if (start instanceof BinaryWebSocketFrame) {
      return new BinaryWebSocketFrame(true, start.rsv(), content);
    }

    // Should not reach here.
    throw new Error();
  }
}
origin: jamesdbloom/mockserver

public void sendClientMessage(String clientId, HttpRequest httpRequest) {
  try {
    if (clientRegistry.containsKey(clientId)) {
      clientRegistry.get(clientId).channel().writeAndFlush(new TextWebSocketFrame(webSocketMessageSerializer.serialize(httpRequest)));
    }
  } catch (Exception e) {
    throw new WebSocketException("Exception while sending web socket message " + httpRequest + " to client " + clientId, e);
  }
}
origin: jamesdbloom/mockserver

void registerClient(String clientId, ChannelHandlerContext ctx) {
  try {
    ctx.channel().writeAndFlush(new TextWebSocketFrame(webSocketMessageSerializer.serialize(new WebSocketClientIdDTO().setClientId(clientId))));
  } catch (Exception e) {
    throw new WebSocketException("Exception while sending web socket registration client id message to client " + clientId, e);
  }
  clientRegistry.put(clientId, ctx);
  Metrics.set(WEBSOCKET_CALLBACK_CLIENT_COUNT, clientRegistry.size());
}
origin: eclipse-vertx/vert.x

WebSocketFrame encodeFrame(WebSocketFrameImpl frame) {
 ByteBuf buf = frame.getBinaryData();
 if (buf != Unpooled.EMPTY_BUFFER) {
  buf = safeBuffer(buf, chctx.alloc());
 }
 switch (frame.type()) {
  case BINARY:
   return new BinaryWebSocketFrame(frame.isFinal(), 0, buf);
  case TEXT:
   return new TextWebSocketFrame(frame.isFinal(), 0, buf);
  case CLOSE:
   return new CloseWebSocketFrame(true, 0, buf);
  case CONTINUATION:
   return new ContinuationWebSocketFrame(frame.isFinal(), 0, buf);
  case PONG:
   return new PongWebSocketFrame(buf);
  case PING:
   return new PingWebSocketFrame(buf);
  default:
   throw new IllegalStateException("Unsupported websocket msg " + frame);
 }
}
origin: spring-projects/spring-framework

protected WebSocketFrame toFrame(WebSocketMessage message) {
  ByteBuf byteBuf = NettyDataBufferFactory.toByteBuf(message.getPayload());
  if (WebSocketMessage.Type.TEXT.equals(message.getType())) {
    return new TextWebSocketFrame(byteBuf);
  }
  else if (WebSocketMessage.Type.BINARY.equals(message.getType())) {
    return new BinaryWebSocketFrame(byteBuf);
  }
  else if (WebSocketMessage.Type.PING.equals(message.getType())) {
    return new PingWebSocketFrame(byteBuf);
  }
  else if (WebSocketMessage.Type.PONG.equals(message.getType())) {
    return new PongWebSocketFrame(byteBuf);
  }
  else {
    throw new IllegalArgumentException("Unexpected message type: " + message.getType());
  }
}
io.netty.handler.codec.http.websocketxTextWebSocketFrame<init>

Javadoc

Creates a new empty text frame.

Popular methods of TextWebSocketFrame

  • text
    Returns the text data in this frame
  • content
  • isFinalFragment
  • fromText
  • retain
  • rsv
  • copy
  • getText
  • release

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
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