Interface RemoteEndpoint

All Known Subinterfaces:
RemoteEndpoint.Async, RemoteEndpoint.Basic

public interface RemoteEndpoint
The RemoteEndpoint object is supplied by the container and represents the 'other end' or peer of the Web Socket conversation. Instances of the RemoteEndpoint are obtained from the Session using Session.getBasicRemote() or Session.getAsyncRemote(). Objects of this kind include numerous ways to send web socket messages. There are two kinds of RemoteEndpoint objects: RemoteEndpoint.Basic for synchronous sending of websocket messages, and RemoteEndpoint.Async for sending messages asynchronously.

There is no guarantee of the successful delivery of a web socket message to the peer, but if the action of sending a message causes an error known to the container, the API throws it. RemoteEndpoints include a variety of ways to send messages: by whole message, in parts, and in various data formats including websocket pings and pongs.

Implementations may or may not support batching of messages. More detail of the expected semantics of implementations that do support batching are laid out in setBatchingAllowed(boolean).

Note: Implementations may choose their own schemes for sending large messages in smaller parts. These schemes may or may not bear a relationship to the underlying websocket dataframes in which the message is ultimately sent on the wire.

If the underlying connection is closed and methods on the RemoteEndpoint are attempted to be called, they will result in an error being generated. For the methods that send messages, this will be an IOException, for the methods that alter configuration of the endpoint, this will be runtime IllegalArgumentExceptions.