send(data, options, cb) {
        const buf = $246d272a9ba49ed8$require$toBuffer(data);
        const perMessageDeflate = this._extensions[$a3204058aeffecb3$exports.extensionName];
        let opcode = options.binary ? 2 : 1;
        let rsv1 = options.compress;
        if (this._firstFragment) {
            this._firstFragment = false;
            if (rsv1 && perMessageDeflate) rsv1 = buf.length >= perMessageDeflate._threshold;
            this._compress = rsv1;
        } else {
            rsv1 = false;
            opcode = 0;
        }
        if (options.fin) this._firstFragment = true;
        if (perMessageDeflate) {
            const opts = {
                fin: options.fin,
                rsv1: rsv1,
                opcode: opcode,
                mask: options.mask,
                readOnly: $246d272a9ba49ed8$require$toBuffer.readOnly
            };
            if (this._deflating) this.enqueue([
                this.dispatch,
                buf,
                this._compress,
                opts,
                cb
            ]);
            else this.dispatch(buf, this._compress, opts, cb);
        } else this.sendFrame($246d272a9ba49ed8$var$Sender.frame(buf, {
            fin: options.fin,
            rsv1: false,
            opcode: opcode,
            mask: options.mask,
            readOnly: $246d272a9ba49ed8$require$toBuffer.readOnly
        }), cb);
    }
/**
   * Sends a data message to the other peer.
   *
   * @param {*} data The message to send
   * @param {Object} options Options object
   * @param {Boolean} [options.compress=false] Specifies whether or not to
   *     compress `data`
   * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
   *     or text
   * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
   *     last one
   * @param {Boolean} [options.mask=false] Specifies whether or not to mask
   *     `data`
   * @param {Function} [cb] Callback
   * @public
   */
Sends a data message to the other peer.
Sends a data message to the other peer .
send(data, options, cb) {
        const buf = $246d272a9ba49ed8$require$toBuffer(data);
        const perMessageDeflate = this._extensions[$a3204058aeffecb3$exports.extensionName];
        let opcode = options.binary ? 2 : 1;
        let rsv1 = options.compress;
        if (this._firstFragment) {
            this._firstFragment = false;
            if (rsv1 && perMessageDeflate) rsv1 = buf.length >= perMessageDeflate._threshold;
            this._compress = rsv1;
        } else {
            rsv1 = false;
            opcode = 0;
        }
        if (options.fin) this._firstFragment = true;
        if (perMessageDeflate) {
            const opts = {
                fin: options.fin,
                rsv1: rsv1,
                opcode: opcode,
                mask: options.mask,
                readOnly: $246d272a9ba49ed8$require$toBuffer.readOnly
            };
            if (this._deflating) this.enqueue([
                this.dispatch,
                buf,
                this._compress,
                opts,
                cb
            ]);
            else this.dispatch(buf, this._compress, opts, cb);
        } else this.sendFrame($246d272a9ba49ed8$var$Sender.frame(buf, {
            fin: options.fin,
            rsv1: false,
            opcode: opcode,
            mask: options.mask,
            readOnly: $246d272a9ba49ed8$require$toBuffer.readOnly
        }), cb);
    }
send ( data , options , cb ) { const buf = $246d272a9ba49ed8$require$toBuffer ( data ) ; const perMessageDeflate = this . _extensions [ $a3204058aeffecb3$exports . extensionName ] ; let opcode = options . binary ? 2 : 1 ; let rsv1 = options . compress ; if ( this . _firstFragment ) { this . _firstFragment = false ; if ( rsv1 && perMessageDeflate ) rsv1 = buf . length >= perMessageDeflate . _threshold ; this . _compress = rsv1 ; } else { rsv1 = false ; opcode = 0 ; } if ( options . fin ) this . _firstFragment = true ; if ( perMessageDeflate ) { const opts = { fin : options . fin , rsv1 : rsv1 , opcode : opcode , mask : options . mask , readOnly : $246d272a9ba49ed8$require$toBuffer . readOnly } ; if ( this . _deflating ) this . enqueue ( [ this . dispatch , buf , this . _compress , opts , cb ] ) ; else this . dispatch ( buf , this . _compress , opts , cb ) ; } else this . sendFrame ( $246d272a9ba49ed8$var$Sender . frame ( buf , { fin : options . fin , rsv1 : false , opcode : opcode , mask : options . mask , readOnly : $246d272a9ba49ed8$require$toBuffer . readOnly } ) , cb ) ; }
Sends a data message to the other peer.
Sends a data message to the other peer .