public abstract class TyrusRemoteEndpoint extends java.lang.Object implements RemoteEndpoint
RemoteEndpoint
and represents the other side of the websocket connection.Modifier and Type | Method and Description |
---|---|
void |
close(CloseReason cr) |
void |
flushBatch()
This method is only used when batching is allowed for this RemoteEndpint.
|
boolean |
getBatchingAllowed()
Return whether the implementation is allowed to batch outgoing messages before sending.
|
void |
sendPing(java.nio.ByteBuffer applicationData)
Send a Ping message containing the given application data to the remote endpoint.
|
void |
sendPong(java.nio.ByteBuffer applicationData)
Allows the developer to send an unsolicited Pong message containing the given application data in order to serve
as a unidirectional heartbeat for the session.
|
void |
setBatchingAllowed(boolean allowed)
Indicate to the implementation that it is allowed to batch outgoing messages before sending.
|
java.lang.String |
toString() |
public void sendPing(java.nio.ByteBuffer applicationData) throws java.io.IOException
RemoteEndpoint
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.
sendPing
in interface RemoteEndpoint
applicationData
- the data to be carried in the ping request.java.io.IOException
- if the ping failed to be sentpublic void sendPong(java.nio.ByteBuffer applicationData) throws java.io.IOException
RemoteEndpoint
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.
sendPong
in interface RemoteEndpoint
applicationData
- the application data to be carried in the pong response.java.io.IOException
- if the pong failed to be sentpublic java.lang.String toString()
toString
in class java.lang.Object
public void setBatchingAllowed(boolean allowed)
RemoteEndpoint
setBatchingAllowed
in interface RemoteEndpoint
allowed
- whether the implementation is allowed to batch messages.public boolean getBatchingAllowed()
RemoteEndpoint
setBatchingAllowed
.getBatchingAllowed
in interface RemoteEndpoint
true
if the implementation is allowed to batch outgoing messages before sending, otherwise
false
public void flushBatch()
RemoteEndpoint
flushBatch
in interface RemoteEndpoint
public void close(CloseReason cr)
Copyright © 2012–2020 Oracle Corporation. All rights reserved.