On 30 June 2012 01:03, Danny Coward <danny.coward_at_oracle.com> wrote:
> WebSocketListener -> public void onMessageAsInputStream(InputStream is)
>
How about having that for blocking API , but for async have the option of
WebSocketAsyncListener - > public void
onMessageAsAsyncByteChannel(AsyncByteChannel channel)
the write methods on the channel would throw IllegalStateException
I'm not the biggest fan of the NIO.2 read API because it requires you to
preallocate the buffers when you call the read - but in this case it is not
so bad as you only allocate the buffers when the first frame of the message
arrives, so you are not holding the buffers forever.
I think better APIs can be designed, but we should at least consider going
with the JVMs standard API
cheers
--
Greg Wilkins <gregw_at_intalio.com>
www.webtide.com
Developer advice, services and support
from the Jetty & CometD experts.