# HG changeset patch # User chegar # Date 1521652253 0 # Node ID 857421616455609f38c412533b7a989065ed80f5 # Parent 58e16ad3fb9824d91e6a7d00c1ae5b2a3c5a5819 http-client-branch: API note about sendPong diff -r 58e16ad3fb98 -r 857421616455 src/java.net.http/share/classes/java/net/http/WebSocket.java --- a/src/java.net.http/share/classes/java/net/http/WebSocket.java Wed Mar 21 16:50:25 2018 +0000 +++ b/src/java.net.http/share/classes/java/net/http/WebSocket.java Wed Mar 21 17:10:53 2018 +0000 @@ -336,6 +336,10 @@ * not more than {@code 125} bytes. These bytes are located from the * buffer's position to its limit. * + * Given that the WebSocket implementation will automatically send a + * reciprocal pong when a ping is received, it is rarely required to + * send a pong message explicitly when a ping is received. + * *

Return a {@code CompletionStage} which will be used by the * {@code WebSocket} as a signal it may reclaim the * {@code ByteBuffer}. Do not access the {@code ByteBuffer} after @@ -568,6 +572,10 @@ * {@code CompletableFuture} returned from this method the buffer will have * no remaining bytes. The buffer must not be accessed until after that. * + * Given that the WebSocket implementation will automatically send a + * reciprocal pong when a ping is received, it is rarely required to send a + * pong message explicitly. + * *

The {@code CompletableFuture} returned from this method can * complete exceptionally with: *