tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: WebSocket: to flip or not the ByteBuffer during sendBinary in RemoteEndpoint(s)
Date Fri, 28 Jun 2013 12:44:24 GMT
On 28/06/2013 12:47, Niki Dokovski wrote:
> Hi folks,
> while playing around with tyrus and tomcat implementation of websocket I
> spotted a difference in the way sendBinary is actually implemented. In
> short: tyrus uses bytebuffer.array(), hence there is no change in buffer's
> position while we end with channel write operation that does this. Neither
> the spec nor the javadoc detail that but the result is that one application
> can run perfectly on one of the implementations and could cause problem on
> the other. Shall we contact the EG for clarification on this matter?

No need. The EG has already stated its view (well, the EG lead did and
no-one disagreed)

Since the spec does not say anything about re-using ByteBuffers and they
are mutable objects, I would expect the conventional developer practice
to be to use a new one each time.

> Opinions?

I agree with the EG lead. Client's should not be making any assumptions
about what the implementation will or won't do with a ByteBuffer.

If you want to argue for a specific behaviour, open an issue against the


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message