Home / Function/ getOpCode() — netty Function Reference

getOpCode() — netty Function Reference

Architecture documentation for the getOpCode() function in WebSocket08FrameEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9667bd30_86eb_265f_83fb_d15408b892e2["getOpCode()"]
  5ff4696d_a24d_bdd9_df0c_04c894aaa3fa["WebSocket08FrameEncoder"]
  9667bd30_86eb_265f_83fb_d15408b892e2 -->|defined in| 5ff4696d_a24d_bdd9_df0c_04c894aaa3fa
  974912aa_4a22_65df_0611_a89a6b21c11d["encode()"]
  974912aa_4a22_65df_0611_a89a6b21c11d -->|calls| 9667bd30_86eb_265f_83fb_d15408b892e2
  style 9667bd30_86eb_265f_83fb_d15408b892e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java lines 226–246

    private static byte getOpCode(WebSocketFrame msg) {
        if (msg instanceof TextWebSocketFrame) {
            return OPCODE_TEXT;
        }
        if (msg instanceof BinaryWebSocketFrame) {
            return OPCODE_BINARY;
        }
        if (msg instanceof PingWebSocketFrame) {
            return OPCODE_PING;
        }
        if (msg instanceof PongWebSocketFrame) {
            return OPCODE_PONG;
        }
        if (msg instanceof CloseWebSocketFrame) {
            return OPCODE_CLOSE;
        }
        if (msg instanceof ContinuationWebSocketFrame) {
            return OPCODE_CONT;
        }
        throw new UnsupportedOperationException("Cannot encode frame of type: " + msg.getClass().getName());
    }

Subdomains

Called By

Frequently Asked Questions

What does getOpCode() do?
getOpCode() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java.
Where is getOpCode() defined?
getOpCode() is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java at line 226.
What calls getOpCode()?
getOpCode() is called by 1 function(s): encode.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free