From ff815f44f595618eca5d5a63d9ab9b77a12cc8cf Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Wed, 10 Nov 2021 18:25:54 +0000 Subject: [PATCH] Further clarification of zero or negative timeout values --- .../java/jakarta/websocket/RemoteEndpoint.java | 6 +++--- .../java/jakarta/websocket/WebSocketContainer.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/client/src/main/java/jakarta/websocket/RemoteEndpoint.java b/api/client/src/main/java/jakarta/websocket/RemoteEndpoint.java index 6b71465..37ccbc6 100644 --- a/api/client/src/main/java/jakarta/websocket/RemoteEndpoint.java +++ b/api/client/src/main/java/jakarta/websocket/RemoteEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020 Oracle and/or its affiliates and others. + * Copyright (c) 2018, 2021 Oracle and/or its affiliates and others. * All rights reserved. * * This program and the accompanying materials are made available under the @@ -132,7 +132,7 @@ interface Async extends RemoteEndpoint { /** * Return the number of milliseconds the implementation will timeout attempting to send a websocket message. A - * non-positive number indicates the implementation will not timeout attempting to send a websocket message + * zero or negative value indicates the implementation will not timeout attempting to send a websocket message * asynchronously. This value overrides the default value assigned in the WebSocketContainer. * * @return the timeout time in milliseconds. @@ -141,7 +141,7 @@ interface Async extends RemoteEndpoint { /** * Sets the number of milliseconds the implementation will timeout attempting to send a websocket message. A - * non-positive number indicates the implementation will not timeout attempting to send a websocket message + * zero or negative value indicates the implementation will not timeout attempting to send a websocket message * asynchronously. This value overrides the default value assigned in the WebSocketContainer. * * @param timeoutmillis The number of milliseconds this RemoteEndpoint will wait before timing out an incomplete diff --git a/api/client/src/main/java/jakarta/websocket/WebSocketContainer.java b/api/client/src/main/java/jakarta/websocket/WebSocketContainer.java index e221b50..04b8509 100644 --- a/api/client/src/main/java/jakarta/websocket/WebSocketContainer.java +++ b/api/client/src/main/java/jakarta/websocket/WebSocketContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019 Oracle and/or its affiliates and others. + * Copyright (c) 2018, 2021 Oracle and/or its affiliates and others. * All rights reserved. * * This program and the accompanying materials are made available under the @@ -38,7 +38,7 @@ public interface WebSocketContainer { /** * Return the number of milliseconds the implementation will timeout attempting to send a websocket message for all - * RemoteEndpoints associated with this container. A non-positive number indicates the implementation will not + * RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not * timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each * RemoteEndpoint. * @@ -48,11 +48,11 @@ public interface WebSocketContainer { /** * Sets the number of milliseconds the implementation will timeout attempting to send a websocket message for all - * RemoteEndpoints associated with this container. A non-positive number indicates the implementation will not + * RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not * timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each * RemoteEndpoint. * - * @param timeoutmillis the timeout in milliseconds or a non-positive number for no timeout + * @param timeoutmillis the timeout in milliseconds; use zero or negative value for no timeout */ void setAsyncSendTimeout(long timeoutmillis); @@ -130,7 +130,7 @@ Session connectToServer(Class endpointClass, ClientEndpointC /** * Return the default time in milliseconds after which any web socket sessions in this container will be closed if - * it has been inactive. A value that is 0 or negative indicates the sessions will never timeout due to inactivity. + * it has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. * The value may be overridden on a per session basis using {@link Session#setMaxIdleTimeout(long) } * * @return the default number of milliseconds after which an idle session in this container will be closed @@ -139,10 +139,10 @@ Session connectToServer(Class endpointClass, ClientEndpointC /** * Sets the default time in milliseconds after which any web socket sessions in this container will be closed if it - * has been inactive. A value that is 0 or negative indicates the sessions will never timeout due to inactivity. The + * has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. The * value may be overridden on a per session basis using {@link Session#setMaxIdleTimeout(long) } * - * @param timeout the maximum time in milliseconds. + * @param timeout the maximum time in milliseconds; use zero or negative value for no timeout */ void setDefaultMaxSessionIdleTimeout(long timeout);