Package org.apache.tomcat.websocket
Class WsRemoteEndpointBase
java.lang.Object
org.apache.tomcat.websocket.WsRemoteEndpointBase
- All Implemented Interfaces:
RemoteEndpoint
- Direct Known Subclasses:
WsRemoteEndpointAsync,WsRemoteEndpointBasic
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.websocket.RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal voidFlush any currently batched messages to the remote endpoint.final booleanObtains the current batching status of the endpoint.final voidsendPing(ByteBuffer applicationData) Send a ping message blocking until the message has been sent.final voidsendPong(ByteBuffer applicationData) Send a pong message blocking until the message has been sent.final voidsetBatchingAllowed(boolean batchingAllowed) Enable or disable the batching of outgoing messages for this endpoint.
-
Field Details
-
base
-
-
Method Details
-
setBatchingAllowed
Description copied from interface:javax.websocket.RemoteEndpointEnable or disable the batching of outgoing messages for this endpoint. If batching is disabled when it was previously enabled then this method will block until any currently batched messages have been written.- Specified by:
setBatchingAllowedin interfaceRemoteEndpoint- Parameters:
batchingAllowed- New setting- Throws:
IOException- If changing the value resulted in a call toRemoteEndpoint.flushBatch()and that call threw anIOException.
-
getBatchingAllowed
public final boolean getBatchingAllowed()Description copied from interface:javax.websocket.RemoteEndpointObtains the current batching status of the endpoint.- Specified by:
getBatchingAllowedin interfaceRemoteEndpoint- Returns:
trueif batching is enabled, otherwisefalse.
-
flushBatch
Description copied from interface:javax.websocket.RemoteEndpointFlush any currently batched messages to the remote endpoint. This method will block until the flush completes.- Specified by:
flushBatchin interfaceRemoteEndpoint- Throws:
IOException- If an I/O error occurs while flushing
-
sendPing
Description copied from interface:javax.websocket.RemoteEndpointSend a ping message blocking until the message has been sent. Note that if a message is in the process of being sent asynchronously, this method will block until that message and this ping has been sent.- Specified by:
sendPingin interfaceRemoteEndpoint- Parameters:
applicationData- The payload for the ping message- Throws:
IOException- If an I/O error occurs while sending the pingIllegalArgumentException- if the applicationData is too large for a control message (max 125 bytes)
-
sendPong
Description copied from interface:javax.websocket.RemoteEndpointSend a pong message blocking until the message has been sent. Note that if a message is in the process of being sent asynchronously, this method will block until that message and this pong has been sent.- Specified by:
sendPongin interfaceRemoteEndpoint- Parameters:
applicationData- The payload for the pong message- Throws:
IOException- If an I/O error occurs while sending the pongIllegalArgumentException- if the applicationData is too large for a control message (max 125 bytes)
-