RFR JDK-8157273: Simplify outgoing messages queueing policy in WebSocket API

Simone Bordet simone.bordet at gmail.com
Mon Jun 13 11:59:36 UTC 2016


Hi,

On Mon, Jun 13, 2016 at 1:44 PM, Pavel Rappo <pavel.rappo at oracle.com> wrote:
> If you're talking about the application scheduling these Pings every X seconds,
> then I have a question. Are we talking about constant rate here or constant
> delay? If it's the former, then I wonder what the application should do if the
> previous Ping at time (t) still hasn't been sent by the time (t + period)?

If it is a mechanism to detect the network roundtrip, constant delay is fine.

> It's related to the following questions I've asked previously.
>
> 1. Does "sendPing" have to wait until the CF returned by the previous
> "sendText|sendBinary" has completed?

sendPing() schedules a ping frame to be sent as soon as possible. When
it is sent, the CF is completed.
How you handle this internally, it's an implementation detail.
If the API semantic for sendX() is "at most one outstanding write" I
would not consider a ping an outstanding write: it can be performed at
any time.

> 2. Does "sendPing" have to wait until the CF returned by the previous sendPing
> has completed?

I'd say no.

-- 
Simone Bordet
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz


More information about the net-dev mailing list