RFR JDK-8156742: Miscellaneous WebSocket API improvements

Pavel Rappo pavel.rappo at oracle.com
Thu Jun 2 20:40:26 UTC 2016


Simone,

> On 2 Jun 2016, at 14:09, Simone Bordet <simone.bordet at gmail.com> wrote:
> 
> I am not opposed to have a utility method sendClose() parameterless,
> but I don't think that it's worth an Optional in onClose(), given the
> semantic defined by 7.1.5.

It all boils down to how apps use contents of Close messages they receive.

You've mentioned several use cases already. I suspect in most cases though the
status code and the reason are just logged.

I have several questions I would appreciate if you give answers to. It will help
me to understand the issue in detail.

Consider an "average" client app from your experience.

1. Are there any cases where the app needs to know that Close message was in fact
empty?

2. Does the app behaviour (especially, parsing the reason phrase/description)
depend on the status code? 

3. If the app initiates the Closing handshake, what Close message does it send?

4. Which codes does the app distinguish?

Thanks,
-Pavel



More information about the net-dev mailing list