Re: [hybi] Technical feedback. was: Process!

Justin Erenkrantz <justin@erenkrantz.com> Tue, 02 February 2010 00:59 UTC

Return-Path: <justin.erenkrantz@gmail.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 17E873A67F2 for <hybi@core3.amsl.com>; Mon, 1 Feb 2010 16:59:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.988
X-Spam-Level:
X-Spam-Status: No, score=-1.988 tagged_above=-999 required=5 tests=[AWL=-0.011, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id psihrH1ofxkR for <hybi@core3.amsl.com>; Mon, 1 Feb 2010 16:59:11 -0800 (PST)
Received: from mail-pz0-f183.google.com (mail-pz0-f183.google.com [209.85.222.183]) by core3.amsl.com (Postfix) with ESMTP id A8B7E3A6767 for <hybi@ietf.org>; Mon, 1 Feb 2010 16:59:08 -0800 (PST)
Received: by pzk13 with SMTP id 13so902242pzk.32 for <hybi@ietf.org>; Mon, 01 Feb 2010 16:59:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=jTrp75u25UzNPi+LNIQyEMJmJjE7hPsrmYmawMajCnA=; b=SjAwZm+JDggdMZMC9uyf8EYCkeQrWFQsD1+0760LFd/iqUoKo2quwscchDhUVeVklK KmFqCVoP1LyG3xjoDJGxtCHpiIyq3FIwIWeqOEo01DKCcj2tmRjfQnicJMawO24uED+7 MqETgg9NhOZjahdFEu+xZaK1vf36njroydVeA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=lbuhemIfPfutvKgtOshU37NnWhYfLEKqy/GVrfdRJ5OgNH6RDLNTFPkW8qcF8d4ccD 33b7Y/tYiZU6X39hMGEnOWD2g4Fpj7sF4bR6FGr/8SlUvW0LBtpRsBWzJ+ahyZ/KBsj6 gY819LtxzfKCyykLZL0kIbzFR6PqV+zcne6uU=
MIME-Version: 1.0
Sender: justin.erenkrantz@gmail.com
Received: by 10.142.122.24 with SMTP id u24mr29800wfc.53.1265072382238; Mon, 01 Feb 2010 16:59:42 -0800 (PST)
In-Reply-To: <Pine.LNX.4.64.1002012348000.3846@ps20323.dreamhostps.com>
References: <de17d48e1001280012i2657b587i83cda30f50013e6b@mail.gmail.com> <4B62C5FE.8090904@it.aoyama.ac.jp> <Pine.LNX.4.64.1001291134350.22020@ps20323.dreamhostps.com> <4B62E516.2010003@webtide.com> <5c902b9e1001290756r3f585204h32cacd6e64fbebaa@mail.gmail.com> <4B636757.3040307@webtide.com> <BBF3CE06-3276-4A7C-8961-7B3DDEE406D0@apple.com> <4B63DC2D.4090702@webtide.com> <5c902b9e1001292325p423d7e82o9478441893e34523@mail.gmail.com> <Pine.LNX.4.64.1002012348000.3846@ps20323.dreamhostps.com>
Date: Mon, 01 Feb 2010 16:59:42 -0800
X-Google-Sender-Auth: 713fb315bc1f29a0
Message-ID: <5c902b9e1002011659g5e755a06wfd3d681a7ba1ee36@mail.gmail.com>
From: Justin Erenkrantz <justin@erenkrantz.com>
To: Ian Hickson <ian@hixie.ch>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Technical feedback. was: Process!
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Feb 2010 00:59:12 -0000

On Mon, Feb 1, 2010 at 3:48 PM, Ian Hickson <ian@hixie.ch> wrote:
> On Fri, 29 Jan 2010, Justin Erenkrantz wrote:
>>
>> Again, this is why the current draft is so impenetrable (to me) since it
>> expects that the only person implementing the draft is a client vendor
>> using synchronous socket methods...which sort of defeats the purpose
>> when you are trying to write a fully async client...or any type of
>> server.
>
> Could you elaborate on this? I looked for text that assumed synchronous
> socket methods but couldn't find any. Could you quote the offending text?

All of them are...such as:

---
          Run these steps.  If at any point during these steps a read is
          attempted but fails because the Web Socket connection is
          closed, then abort.

          1.  Let /length/ be zero.

          2.  _Length_: Read a byte, let /b/ be that byte.

          3.  Let /b_v/ be integer corresponding to the low 7 bits of
              /b/ (the value you would get by _and_ing /b/ with 0x7F).

          4.  Multiply /length/ by 128, add /b_v/ to that result, and
              store the final result in /length/.

          5.  If the high-order bit of /b/ is set (i.e. if /b/ _and_ed
              with 0x80 returns 0x80), then return to the step above
              labeled _length_.

          6.  Read /length/ bytes.

          7.  Discard the read bytes.
---

Greg pointed out issues as to what "send" or "receive" means -
buffering, etc, etc.

The algorithmic descriptions can only be precisely followed when you
write a synchronous client (or server) - the algorithms for an network
async read or write framework would appear hugely different.  Again, I
think this challenges the usefulness of specifying the protocol in
pseudo-code when many (optimized?) implementations won't be able to
follow those same algorithms.  -- justin