Class WsRemoteEndpointBasic
java.lang.Object
org.apache.tomcat.websocket.WsRemoteEndpointBase
org.apache.tomcat.websocket.WsRemoteEndpointBasic
- All Implemented Interfaces:
RemoteEndpoint, RemoteEndpoint.Basic
Synchronous (basic) remote endpoint for sending WebSocket messages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic -
Field Summary
Fields inherited from class WsRemoteEndpointBase
base -
Method Summary
Modifier and TypeMethodDescriptionReturns anOutputStreamfor sending a binary message to the remote endpoint.Returns aWriterfor sending a text message to the remote endpoint.voidsendBinary(ByteBuffer data) Send the message, blocking until the message is sent.voidsendBinary(ByteBuffer partialByte, boolean isLast) Sends part of a binary message to the remote endpoint.voidsendObject(Object o) Encodes object as a message and sends it to the remote endpoint.voidSend the message, blocking until the message is sent.voidSends part of a text message to the remote endpoint.Methods inherited from class WsRemoteEndpointBase
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RemoteEndpoint
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed
-
Method Details
-
sendText
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicSend the message, blocking until the message is sent.- Specified by:
sendTextin interfaceRemoteEndpoint.Basic- Parameters:
text- The text message to send.- Throws:
IOException- if an I/O error occurs during the sending of the message.
-
sendBinary
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicSend the message, blocking until the message is sent.- Specified by:
sendBinaryin interfaceRemoteEndpoint.Basic- Parameters:
data- The binary message to send- Throws:
IOException- if an I/O error occurs during the sending of the message.
-
sendText
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicSends part of a text message to the remote endpoint. Once the first part of a message has been sent, no other text or binary messages may be sent until all remaining parts of this message have been sent.- Specified by:
sendTextin interfaceRemoteEndpoint.Basic- Parameters:
fragment- The partial message to sendisLast-trueif this is the last part of the message, otherwisefalse- Throws:
IOException- if an I/O error occurs during the sending of the message.
-
sendBinary
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicSends part of a binary message to the remote endpoint. Once the first part of a message has been sent, no other text or binary messages may be sent until all remaining parts of this message have been sent.- Specified by:
sendBinaryin interfaceRemoteEndpoint.Basic- Parameters:
partialByte- The partial message to sendisLast-trueif this is the last part of the message, otherwisefalse- Throws:
IOException- if an I/O error occurs during the sending of the message.
-
getSendStream
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicReturns anOutputStreamfor sending a binary message to the remote endpoint.- Specified by:
getSendStreamin interfaceRemoteEndpoint.Basic- Returns:
- An output stream for sending binary data
- Throws:
IOException- if an I/O error occurs
-
getSendWriter
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicReturns aWriterfor sending a text message to the remote endpoint.- Specified by:
getSendWriterin interfaceRemoteEndpoint.Basic- Returns:
- A writer for sending text data
- Throws:
IOException- if an I/O error occurs
-
sendObject
Description copied from interface:jakarta.websocket.RemoteEndpoint.BasicEncodes object as a message and sends it to the remote endpoint.- Specified by:
sendObjectin interfaceRemoteEndpoint.Basic- Parameters:
o- The object to be sent.- Throws:
IOException- if an I/O error occurs during the sending of the message.EncodeException- if there was a problem encoding thedataobject as a websocket message.
-