jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Proposal for WebSocket to be part of JSR 340

From: Alex Rojkov <alex_at_caucho.com>
Date: Fri, 7 Oct 2011 09:57:07 -0700

>> I am strongly pro-stream because a stream based API gives the programmer
>> flexibility to read in chunks that are appropriate for the application or a framework
>> which may be a more frequent case.

This was misunderstood actually.

I said 'chunks' but really meant 'chunk' as in void read(byte[] chunk/ buffer) where the size of
the buffer is defined by an application or a framework.

So I agree that semantic meaning is attached to the whole message, not its part.

Alex

> So I think that avoiding huge buffers is a reasonable argument for
> streaming APIs, but allowing semantic interpretation of partial
> messages is not.

>> Consider a case where you need to stream megabytes of data from a client
>> to the server. This is a frequent case and it should be solvable in a manner
>> that no strenuous on memory. Especially when many clients do the same.
>
> Send the megabytes as lots of small WS messages.
>
> regards
>
>