Home / File/ CloseWebSocketFrame.java — netty Source File

CloseWebSocketFrame.java — netty Source File

Architecture documentation for CloseWebSocketFrame.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2019 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.handler.codec.http.websocketx;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;
import io.netty.util.internal.StringUtil;

/**
 * Web Socket Frame for closing the connection.
 */
public class CloseWebSocketFrame extends WebSocketFrame {

    /**
     * Creates a new empty close frame.
     */
    public CloseWebSocketFrame() {
        super(Unpooled.buffer(0));
    }

    /**
     * Creates a new empty close frame with closing status code and reason text
     *
     * @param status
     *            Status code as per <a href="https://tools.ietf.org/html/rfc6455#section-7.4">RFC 6455</a>. For
     *            example, <tt>1000</tt> indicates normal closure.
     */
    public CloseWebSocketFrame(WebSocketCloseStatus status) {
        this(requireValidStatusCode(status.code()), status.reasonText());
    }

    /**
     * Creates a new empty close frame with closing status code and reason text
     *
     * @param status
     *            Status code as per <a href="https://tools.ietf.org/html/rfc6455#section-7.4">RFC 6455</a>. For
     *            example, <tt>1000</tt> indicates normal closure.
     * @param reasonText
     *            Reason text. Set to null if no text.
     */
    public CloseWebSocketFrame(WebSocketCloseStatus status, String reasonText) {
        this(requireValidStatusCode(status.code()), reasonText);
    }

    /**
     * Creates a new empty close frame with closing status code and reason text
// ... (147 more lines)

Subdomains

Frequently Asked Questions

What does CloseWebSocketFrame.java do?
CloseWebSocketFrame.java is a source file in the netty codebase, written in java. It belongs to the ProtocolCodecs domain, HTTP subdomain.
Where is CloseWebSocketFrame.java in the architecture?
CloseWebSocketFrame.java is located at codec-http/src/main/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java (domain: ProtocolCodecs, subdomain: HTTP, directory: codec-http/src/main/java/io/netty/handler/codec/http/websocketx).

Analyze Your Own Codebase

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

Try Supermodel Free