Re: [hybi] Max frame size

Francis Brosnan Blázquez <> Thu, 23 June 2011 11:01 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id A055D11E807F for <>; Thu, 23 Jun 2011 04:01:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 2.584
X-Spam-Level: **
X-Spam-Status: No, score=2.584 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_HOST_ALMOST_IP=1.889, HOST_EQ_STATIC=1.172, HOST_EQ_STATICIP=1.511, HOST_MISMATCH_NET=0.311, MIME_8BIT_HEADER=0.3]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id k4fk2s29VAmh for <>; Thu, 23 Jun 2011 04:01:06 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id C120F9E8012 for <>; Thu, 23 Jun 2011 04:01:04 -0700 (PDT)
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9D2761170003; Thu, 23 Jun 2011 13:01:01 +0200 (CEST)
X-Virus-Scanned: amavisd-new at
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 8RWeVjFTOkKT; Thu, 23 Jun 2011 13:01:00 +0200 (CEST)
Received: from [] (unknown []) (Authenticated sender: acinom) by (Postfix) with ESMTPA id 1EBF51170001; Thu, 23 Jun 2011 13:01:00 +0200 (CEST)
From: Francis Brosnan =?ISO-8859-1?Q?Bl=E1zquez?= <>
To: Scott Ferguson <>
In-Reply-To: <>
References: <1308720860.5393.18.camel@tot.local> <> <1308738811.11941.704.camel@vulcan.aspl.local> <> <1308756913.11941.823.camel@vulcan.aspl.local> <>
Content-Type: text/plain
Date: Thu, 23 Jun 2011 13:01:01 +0200
Message-Id: <1308826861.11268.47.camel@tot.local>
Mime-Version: 1.0
X-Mailer: Evolution
Content-Transfer-Encoding: 7bit
Subject: Re: [hybi] Max frame size
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 23 Jun 2011 11:01:06 -0000

Hi Scott,

> >> I don't see the difference with frames. You can call the application saying
> >> "hey, here come 5 GB of data, please read them from this connection handle".
> > Ok, the way it should be done, assuming we have a message/frame oriented
> > protocol, is that the app level register a handler which is called every
> > time a single frame is received.
> No. It's like a HTTP chunked POST, where the application receives a 
> stream of data, not the underlying HTTP chunks.
> A server (or client) which exposes the frames as its primary API is 
> doing it wrong.

I think you are getting my wrong maybe because I mentioned "...which is
called every single frame is received", but obviously my point is
focused on the concept of having a handler called when a frame "with
useful app level data (message)", not control frames directed to the

>From websocket draft we can read:

   The WebSocket protocol uses this framing so that specifications that
   use the WebSocket protocol can expose such connections using an
   event-based mechanism instead of requiring users of those
   specifications to implement buffering and piecing together of
   messages manually.

This definition matches the handler concept I'm exposing and...current
websocket javascript API (on message event).

> > This way, the handler is called, for example, each 4k, so the handler
> > can receive those 5GB with minimum memory allocation and with the
> > security it handles messages not raw access to a file descriptor (with
> > the security and code complexity implications it has).
> See stdio.h, specifically the FILE methods like fdopen, fread, fgets, 
> etc. That's the level of abstraction the application needs to see.

..and you really think this API is suitable for a message oriented
protocol? (I assuming your fread concept will return bytes as it comes
not complete messages)

While I see this API makes the buffering (max frame size) problem for
the websocket developer to be not an issue, is in fact not solving but
moving the problem to the app level where, again, the application will
have to buffer the content until a message is completed.

I still think we need a way to each party to notify its buffering or
message size limit capabilities, *mainly*, because we have a framing
designed to notify messages, defined as *units* by the draft, not

> -- Scott
> >> Regards,
> >> Willy
> >>
> _______________________________________________
> hybi mailing list