Package org.apache.tomcat.websocket
Class WsRemoteEndpointBase
- java.lang.Object
-
- org.apache.tomcat.websocket.WsRemoteEndpointBase
-
- All Implemented Interfaces:
RemoteEndpoint
- Direct Known Subclasses:
WsRemoteEndpointAsync
,WsRemoteEndpointBasic
public abstract class WsRemoteEndpointBase extends java.lang.Object implements RemoteEndpoint
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.websocket.RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
-
-
Field Summary
Fields Modifier and Type Field Description protected WsRemoteEndpointImplBase
base
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flushBatch()
Flush any currently batched messages to the remote endpoint.boolean
getBatchingAllowed()
Obtains the current batching status of the endpoint.void
sendPing(java.nio.ByteBuffer applicationData)
Send a ping message blocking until the message has been sent.void
sendPong(java.nio.ByteBuffer applicationData)
Send a pong message blocking until the message has been sent.void
setBatchingAllowed(boolean batchingAllowed)
Enable or disable the batching of outgoing messages for this endpoint.
-
-
-
Field Detail
-
base
protected final WsRemoteEndpointImplBase base
-
-
Method Detail
-
setBatchingAllowed
public final void setBatchingAllowed(boolean batchingAllowed) throws java.io.IOException
Description copied from interface:jakarta.websocket.RemoteEndpoint
Enable 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:
setBatchingAllowed
in interfaceRemoteEndpoint
- Parameters:
batchingAllowed
- New setting- Throws:
java.io.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:jakarta.websocket.RemoteEndpoint
Obtains the current batching status of the endpoint.- Specified by:
getBatchingAllowed
in interfaceRemoteEndpoint
- Returns:
true
if batching is enabled, otherwisefalse
.
-
flushBatch
public final void flushBatch() throws java.io.IOException
Description copied from interface:jakarta.websocket.RemoteEndpoint
Flush any currently batched messages to the remote endpoint. This method will block until the flush completes.- Specified by:
flushBatch
in interfaceRemoteEndpoint
- Throws:
java.io.IOException
- If an I/O error occurs while flushing
-
sendPing
public final void sendPing(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentException
Description copied from interface:jakarta.websocket.RemoteEndpoint
Send 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:
sendPing
in interfaceRemoteEndpoint
- Parameters:
applicationData
- The payload for the ping message- Throws:
java.io.IOException
- If an I/O error occurs while sending the pingjava.lang.IllegalArgumentException
- if the applicationData is too large for a control message (max 125 bytes)
-
sendPong
public final void sendPong(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentException
Description copied from interface:jakarta.websocket.RemoteEndpoint
Send 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:
sendPong
in interfaceRemoteEndpoint
- Parameters:
applicationData
- The payload for the pong message- Throws:
java.io.IOException
- If an I/O error occurs while sending the pongjava.lang.IllegalArgumentException
- if the applicationData is too large for a control message (max 125 bytes)
-
-