Preliminary RFR JDK-8159053: Improve onPing/onClose behavior

Chris Hegarty chris.hegarty at oracle.com
Thu Jun 23 13:58:22 UTC 2016


> On 23 Jun 2016, at 14:48, Simone Bordet <simone.bordet at gmail.com> wrote:
> 
> ...
> 
> WebSocket's close mechanism is a double half close, like TCP.
> In TCP the semantic is very clear: sideA can half close, sideB can
> continue sending data, sideA will continue reading data, until sideB
> half closes.
> Same semantic in WebSocket.

At one point I thought the same, but after, yet another, re-reading of the RFC
I disagree. The semantics are somewhat stronger in WebSocket, albeit that
the wording is a little squirrely :

5.5.1 Close [1]

   It SHOULD do so as soon as practical.  An
   endpoint MAY delay sending a Close frame until its current message is
   sent (for instance, if the majority of a fragmented message is
   already sent, an endpoint MAY send the remaining fragments before
   sending a Close frame). 


-Chris.

[1] https://tools.ietf.org/html/rfc6455#section-5.5.1


More information about the net-dev mailing list