Package org.apache.tomcat.websocket
Class WsRemoteEndpointAsync
java.lang.Object
org.apache.tomcat.websocket.WsRemoteEndpointBase
org.apache.tomcat.websocket.WsRemoteEndpointAsync
- All Implemented Interfaces:
RemoteEndpoint
,RemoteEndpoint.Async
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.websocket.RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
-
Field Summary
Fields inherited from class org.apache.tomcat.websocket.WsRemoteEndpointBase
base
-
Method Summary
Modifier and TypeMethodDescriptionlong
Obtain the timeout (in milliseconds) for sending a message asynchronously.sendBinary
(ByteBuffer data) Send the message asynchronously, using the Future to signal to the client when the message has been sent.void
sendBinary
(ByteBuffer data, SendHandler completion) Send the message asynchronously, using the SendHandler to signal to the client when the message has been sent.sendObject
(Object obj) Encodes object as a message and sends it asynchronously, using the Future to signal to the client when the message has been sent.void
sendObject
(Object obj, SendHandler completion) Encodes object as a message and sends it asynchronously, using the SendHandler to signal to the client when the message has been sent.Send the message asynchronously, using the Future to signal to the client when the message has been sent.void
sendText
(String text, SendHandler completion) Send the message asynchronously, using the SendHandler to signal to the client when the message has been sent.void
setSendTimeout
(long timeout) Set the timeout (in milliseconds) for sending a message asynchronously.Methods inherited from class org.apache.tomcat.websocket.WsRemoteEndpointBase
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.websocket.RemoteEndpoint
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed
-
Method Details
-
getSendTimeout
public long getSendTimeout()Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Obtain the timeout (in milliseconds) for sending a message asynchronously. The default value is determined byWebSocketContainer.getDefaultAsyncSendTimeout()
.- Specified by:
getSendTimeout
in interfaceRemoteEndpoint.Async
- Returns:
- The current send timeout in milliseconds. A non-positive value means an infinite timeout.
-
setSendTimeout
public void setSendTimeout(long timeout) Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Set the timeout (in milliseconds) for sending a message asynchronously. The default value is determined byWebSocketContainer.getDefaultAsyncSendTimeout()
.- Specified by:
setSendTimeout
in interfaceRemoteEndpoint.Async
- Parameters:
timeout
- The new timeout for sending messages asynchronously in milliseconds. A non-positive value means an infinite timeout.
-
sendText
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Send the message asynchronously, using the SendHandler to signal to the client when the message has been sent.- Specified by:
sendText
in interfaceRemoteEndpoint.Async
- Parameters:
text
- The text message to sendcompletion
- Used to signal to the client when the message has been sent
-
sendText
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Send the message asynchronously, using the Future to signal to the client when the message has been sent.- Specified by:
sendText
in interfaceRemoteEndpoint.Async
- Parameters:
text
- The text message to send- Returns:
- A Future that signals when the message has been sent.
-
sendBinary
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Send the message asynchronously, using the Future to signal to the client when the message has been sent.- Specified by:
sendBinary
in interfaceRemoteEndpoint.Async
- Parameters:
data
- The text message to send- Returns:
- A Future that signals when the message has been sent.
-
sendBinary
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Send the message asynchronously, using the SendHandler to signal to the client when the message has been sent.- Specified by:
sendBinary
in interfaceRemoteEndpoint.Async
- Parameters:
data
- The text message to sendcompletion
- Used to signal to the client when the message has been sent
-
sendObject
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Encodes object as a message and sends it asynchronously, using the Future to signal to the client when the message has been sent.- Specified by:
sendObject
in interfaceRemoteEndpoint.Async
- Parameters:
obj
- The object to be sent.- Returns:
- A Future that signals when the message has been sent.
-
sendObject
Description copied from interface:jakarta.websocket.RemoteEndpoint.Async
Encodes object as a message and sends it asynchronously, using the SendHandler to signal to the client when the message has been sent.- Specified by:
sendObject
in interfaceRemoteEndpoint.Async
- Parameters:
obj
- The object to be sent.completion
- Used to signal to the client when the message has been sent
-