Tabnine Logo
TextWebSocketFrame.release
Code IndexAdd Tabnine to your IDE (free)

How to use
release
method
in
io.netty.handler.codec.http.websocketx.TextWebSocketFrame

Best Java code snippets using io.netty.handler.codec.http.websocketx.TextWebSocketFrame.release (Showing top 1 results out of 315)

origin: stackoverflow.com

 public void channelRead(ChannelHandlerContext ctx, Object msg) /* throws Exception */
  TextWebSocketFrame frame = (TextWebSocketFrame) msg;
  try {

    String json = frame.text(); 
    JSONObject jsonObject = new JSONObject(json);
    int type = jsonObject.getInt("type");
    JSONArray msgJsonArray = jsonObject.getJSONArray("msg");
    String user = msgJsonArray.getString(0);
    String pass = msgJsonArray.getString(1);
    String connectionkey = msgJsonArray.getString(2);
    int timestamp = jsonObject.getInt("timestamp");

    JSONObject responseJson = new JSONObject();
    responseJson.put("type",Config.LOGIN_SUCCESS);
    responseJson.put("connectionkey",connectionkey);

    ctx.writeAndFlush(responseJson)
  } finally {
    frame.release();
  }
}
io.netty.handler.codec.http.websocketxTextWebSocketFramerelease

Popular methods of TextWebSocketFrame

  • <init>
    Creates a new text frame with the specified text string. The final fragment flag is set to true.
  • text
    Returns the text data in this frame
  • content
  • isFinalFragment
  • fromText
  • retain
  • rsv
  • copy
  • getText

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now