File: //lib64/python3.6/site-packages/tornado/__pycache__/websocket.cpython-36.opt-1.pyc
3
��f�� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZ ddl
Z ddlmZ ddl
Z
ddlmZmZ ddlmZmZmZ ddl mZmZmZ ddlmZmZ ddlmZmZ dd lmZmZ dd
l m Z ddl!m"Z" ddl#m$Z$ dd
l%m&Z& ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 ddl3m4Z4 e(�rzddl5m6Z6 G dd� de6�Z7G dd� de6�Z8G dd� de6�Z9d6Z:G dd� de;�Z<G dd� de<�Z=G dd� de;�Z>G dd � d e?�Z@G d!d"� d"e jAjB�ZCe*e*dd#�d$d%�ZDG d&d'� d'ejE�ZFG d(d)� d)e?�ZGG d*d+� d+e?�ZHG d,d-� d-eF�ZIG d.d/� d/e jJ�ZKdddddde:dfe-eLejMf e0d0gdf eNe0e-deLeOf gdf e,eLe*f eNeNePe.eL d1d2�
d3d4�ZQdS )7a� Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer to http://caniuse.com/websockets for details).
This module implements the final version of the WebSocket protocol as
defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_. Certain
browser versions (notably Safari 5.x) implemented an earlier draft of
the protocol (known as "draft 76") and are not compatible with this module.
.. versionchanged:: 4.0
Removed support for the draft 76 protocol version.
� N)�urlparse)�Future�"future_set_result_unless_cancelled)�utf8�
native_str�
to_unicode)�gen�
httpclient�httputil)�IOLoop�PeriodicCallback)�StreamClosedError�IOStream)�gen_log�app_log)�simple_httpclient)�Queue)� TCPClient)�_websocket_mask)�
TYPE_CHECKING�cast�Any�Optional�Dict�Union�List� Awaitable�Callable�Tuple�Type)�
TracebackType)�Protocolc @ s, e Zd Zeed�dd�Zeed�dd�ZdS )�_Compressor)�data�returnc C s d S )N� )�selfr# r% r% �!/usr/lib64/python3.6/websocket.py�compress? s z_Compressor.compress)�moder$ c C s d S )Nr% )r&