On Wed, Feb 15, 2012 at 12:10 PM, Mark Thomas <ma...@apache.org> wrote:

> On 15/02/2012 19:58, Costin Manolache wrote:
> > In spdy I'm using a SpdyFrame class ( spdy allow data frames to be
> > fragmented any
> > way you want by intermediary - so even if I receive a huge frame, I can
> > split it
> > in buffer-sized frames  - I believe you can do the same for websocket, as
> > long as you
> > preserve the message boundaries), and return the real buffer to avoid the
> > copy required
> > for read(b[]). But of it involves a releaseBuffer().
> > Take a look - if/when we have websocket-over-spdy it would be good to be
> > consistent.
>
> Unfortunately that isn't guaranteed to be possible. To quote from the spec:
>
> "An intermediary MUST NOT change the fragmentation of any message in the
> context of a connection where extensions have been negotiated and the
> intermediary is not aware of the semantics of the negotiated extensions."
>

That doesn't mean the application must receive the entire message as one
byte[]
or as a Stream.
You can have a very large fragment but still read it in smaller buffers and
notify
the user of message start and for each fragment ( I guess like xml parsing
).



Costin


>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to