Re: [hybi] Framing take IV

Jamie Lokier <jamie@shareable.org> Wed, 04 August 2010 02:15 UTC

Return-Path: <jamie@shareable.org>
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 3E4CC3A6A11 for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 19:15:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.505
X-Spam-Level:
X-Spam-Status: No, score=-2.505 tagged_above=-999 required=5 tests=[AWL=0.094, BAYES_00=-2.599]
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 iWOKn9tjvrgI for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 19:14:58 -0700 (PDT)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 279883A6A20 for <hybi@ietf.org>; Tue, 3 Aug 2010 19:14:58 -0700 (PDT)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1OgTVs-0005B4-R3; Wed, 04 Aug 2010 03:15:24 +0100
Date: Wed, 04 Aug 2010 03:15:24 +0100
From: Jamie Lokier <jamie@shareable.org>
To: Scott Ferguson <ferg@caucho.com>
Message-ID: <20100804021524.GS27827@shareable.org>
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <28A6543A-5CA6-42B7-8D2E-F5511EE20008@apple.com> <4C58C2F6.8050608@caucho.com> <Pine.LNX.4.64.1008040132190.5947@ps20323.dreamhostps.com> <4C58C4C8.5020900@caucho.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <4C58C4C8.5020900@caucho.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV
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: Wed, 04 Aug 2010 02:15:05 -0000

Scott Ferguson wrote:
> Ian Hickson wrote:
> >On Tue, 3 Aug 2010, Scott Ferguson wrote:
> >  
> >>>I agree. I can't see any benefit to fragmentation over a variable-size 
> >>>length field for an initial version without multiplexing. If the 
> >>>variable-size length field is well-designed, then in the common case 
> >>>where the message size is small it will only cost one extra branch to 
> >>>read the length. In the rare case where the message size is large, a 
> >>>variable-size length is easier to deal with than reassembling 
> >>>fragments, and easier on the sending side too.
> >>>      
> >>Some of us don't have infinite memory when sending messages.
> >>    
> >
> >Why do you need infinite memory?
> >  
> 
> Because we don't know the length of dynamically produced content until 
> the dynamic process is complete. That's why HTTP added chunking.

I agree (and favour chunking like this), however there is a
counterargument (which shouldn't be assumed to have my support):

The JS API does not permit incremental delivery of parts of a message
as they arrive, so from the JS API perspective, everything is done
with whole messages.

If you have incrementally delivered large messages, it's possible to
write a WebSocket protocol that depends on this (maybe even
bidirectionally) and is usable by non-JS clients, yet is impossible to
use from JS API browser clients.

So if you want to send large messages of unknown size that are sure to
be equally accessible to the JS API as other clients, think in terms
of "joining messages in an application-visible manner" rather than
splitting them.

-- Jamie