Package javax.websocket
Interface RemoteEndpoint
- 
- All Known Subinterfaces:
- RemoteEndpoint.Async,- RemoteEndpoint.Basic
 
 public interface RemoteEndpoint
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceRemoteEndpoint.Asyncstatic interfaceRemoteEndpoint.Basic
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidflushBatch()Flush any currently batched messages to the remote endpoint.booleangetBatchingAllowed()Obtains the current batching status of the endpoint.voidsendPing(java.nio.ByteBuffer applicationData)Send a ping message blocking until the message has been sent.voidsendPong(java.nio.ByteBuffer applicationData)Send a pong message blocking until the message has been sent.voidsetBatchingAllowed(boolean batchingAllowed)Enable or disable the batching of outgoing messages for this endpoint.
 
- 
- 
- 
Method Detail- 
setBatchingAllowedvoid setBatchingAllowed(boolean batchingAllowed) throws java.io.IOExceptionEnable 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.- Parameters:
- batchingAllowed- New setting
- Throws:
- java.io.IOException- If changing the value resulted in a call to- flushBatch()and that call threw an- IOException.
 
 - 
getBatchingAllowedboolean getBatchingAllowed() Obtains the current batching status of the endpoint.- Returns:
- trueif batching is enabled, otherwise- false.
 
 - 
flushBatchvoid flushBatch() throws java.io.IOExceptionFlush any currently batched messages to the remote endpoint. This method will block until the flush completes.- Throws:
- java.io.IOException- If an I/O error occurs while flushing
 
 - 
sendPingvoid sendPing(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentExceptionSend 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.- Parameters:
- applicationData- The payload for the ping message
- Throws:
- java.io.IOException- If an I/O error occurs while sending the ping
- java.lang.IllegalArgumentException- if the applicationData is too large for a control message (max 125 bytes)
 
 - 
sendPongvoid sendPong(java.nio.ByteBuffer applicationData) throws java.io.IOException, java.lang.IllegalArgumentExceptionSend 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.- Parameters:
- applicationData- The payload for the pong message
- Throws:
- java.io.IOException- If an I/O error occurs while sending the pong
- java.lang.IllegalArgumentException- if the applicationData is too large for a control message (max 125 bytes)
 
 
- 
 
-