Endpoints
Tip icon
To better understand this section, examine the sample SstHttpClientExample.
Endpoints are the basic element of location within SST. They also provide you an interface to the byte-wise messaging operations in SST. Endpoints are transport-independent and are either local or remote. Remote endpoints are representations of some remote location to which data can be sent and from which data can be received. They have an associated URL and transport specific address. Local endpoints also have a transport (see Transports) which is used for sending and receiving data.
Endpoints provide you with a very small common "initialization" and "runtime" (as opposed to configuration time) API which is consistent across all transports.
The semantics of the endpoint messaging operations (for example, send, receive, reply) depend entirely on the underlying transport used. No attempt is made to wrapper or otherwise hide transport semantics. Thus, if a transport supports security, then messages will be sent with the appropriate handshaking and tokens. If the transport guarantees delivery then the sender will receive an error when remote machines crash. Conversely, if the underlying transports do not support these facilities, no attempt is made to emulate them. In addition, SST does not enforce a synchronous or asynchronous messaging model but rather exposes the underlying transport semantics.
Endpoints are not connection-oriented. For some transports which support connections (for example, TCP), endpoints might correspond to transport connections but this relationship is neither exposed nor guaranteed by SST. You should use caution if relying on transport-dependent properties as their code will be less portable and hence sensitive to changes in underlying transport implementation.
Individual transport semantics and configuration options are exposed in an explicit way through transport-specific configuration objects (see Transport configurations) which you can manipulate.
The runtime API includes the following methods on instances of subclasses of SstLocalEndpoint:
send: message to: target
Sends the @message to @target. Blocks until all data has been sent.
reply: message to: target
Sends @message to @target as a reply. Block until all data has been sent. For transports which do not support a reply mechanism, this will be the equivalent of a send:to:.
receive
Blocks until a message is received from a peer. Answers the message on success, or an error should one occur.
configuration
Answers the receiver's configuration. The configuration sets various transport-specific values to control the transport's behavior.
accessibleUrls
Answers a collection of URLs that can be used to communicate with the receiver.
Last modified date: 04/20/2020