View Javadoc

    1   /*
    2    * Copyright 2012 The Netty Project
    3    *
    4    * The Netty Project licenses this file to you under the Apache License,
    5    * version 2.0 (the "License"); you may not use this file except in compliance
    6    * with the License. You may obtain a copy of the License at:
    7    *
    8    *   http://www.apache.org/licenses/LICENSE-2.0
    9    *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    13   * License for the specific language governing permissions and limitations
    14   * under the License.
    15   */
    16  // (BSD License: http://www.opensource.org/licenses/bsd-license)
    17  //
    18  // Copyright (c) 2011, Joe Walnes and contributors
    19  // All rights reserved.
    20  //
    21  // Redistribution and use in source and binary forms, with or
    22  // without modification, are permitted provided that the
    23  // following conditions are met:
    24  //
    25  // * Redistributions of source code must retain the above
    26  // copyright notice, this list of conditions and the
    27  // following disclaimer.
    28  //
    29  // * Redistributions in binary form must reproduce the above
    30  // copyright notice, this list of conditions and the
    31  // following disclaimer in the documentation and/or other
    32  // materials provided with the distribution.
    33  //
    34  // * Neither the name of the Webbit nor the names of
    35  // its contributors may be used to endorse or promote products
    36  // derived from this software without specific prior written
    37  // permission.
    38  //
    39  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
    40  // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
    41  // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    42  // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    43  // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
    44  // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    45  // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    46  // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
    47  // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    48  // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    49  // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    50  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    51  // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    52  // POSSIBILITY OF SUCH DAMAGE.
    53
    54  package org.jboss.netty.handler.codec.http.websocketx;
    55
    56  /**
    57   * Decodes a web socket frame from wire protocol version 13 format. V13 is
    58   * essentially the same as V8.
    59   */
    60  public class WebSocket13FrameDecoder extends WebSocket08FrameDecoder {
    61
    62      /**
    63       * Constructor with default values
    64       *
    65       * @param maskedPayload
    66       *            Web socket servers must set this to true processed incoming masked payload. Client implementations
    67       *            must set this to false.
    68       * @param allowExtensions
    69       *            Flag to allow reserved extension bits to be used or not
    70       */
    71      public WebSocket13FrameDecoder(boolean maskedPayload, boolean allowExtensions) {
    72          this(maskedPayload, allowExtensions, Long.MAX_VALUE);
    73      }
    74
    75      /**
    76       * Constructor
    77       *
    78       * @param maskedPayload
    79       *            Web socket servers must set this to true processed incoming
    80       *            masked payload. Client implementations must set this to false.
    81       * @param allowExtensions
    82       *            Flag to allow reserved extension bits to be used or not
    83       * @param maxFramePayloadLength
    84       *            Maximum length of a frame's payload. Setting this to an
    85       *            appropriate value for you application helps check for denial
    86       *            of services attacks.
    87       */
    88      public WebSocket13FrameDecoder(boolean maskedPayload, boolean allowExtensions, long maxFramePayloadLength) {
    89          super(maskedPayload, allowExtensions, maxFramePayloadLength);
    90      }
    91  }