Class AssociationHandle
A Service Provider Interface (SPI) layer for abstracting over logical links (associations) created by a Transport. Handles are responsible for providing an API for sending and receiving from the underlying channel.
To register a listener for processing incoming payload data, the listener must be registered by completing the Task returned by ReadHandlerSource. Incoming data is not processed until this registration takes place.
Inherited Members
Namespace: Akka.Remote.Transport
Assembly: Akka.Remote.dll
Syntax
public abstract class AssociationHandle
Constructors
| Improve this Doc View SourceAssociationHandle(Address, Address)
Creates a handle to an association between two remote addresses.
Declaration
protected AssociationHandle(Address localAddress, Address remoteAddress)
Parameters
Type | Name | Description |
---|---|---|
Address | localAddress | The local address to use. |
Address | remoteAddress | The remote address to use. |
Properties
| Improve this Doc View SourceLocalAddress
Address of the local endpoint
Declaration
public Address LocalAddress { get; protected set; }
Property Value
Type | Description |
---|---|
Address |
ReadHandlerSource
The TaskCompletionSource returned by this call must be completed with an IHandleEventListener to register a listener responsible for handling the incoming payload. Until the listener is not registered the transport SHOULD buffer incoming messages.
Declaration
public TaskCompletionSource<IHandleEventListener> ReadHandlerSource { get; protected set; }
Property Value
Type | Description |
---|---|
TaskCompletionSource<IHandleEventListener> |
RemoteAddress
Address of the remote endpoint
Declaration
public Address RemoteAddress { get; protected set; }
Property Value
Type | Description |
---|---|
Address |
Methods
| Improve this Doc View SourceDisassociate()
Closes the underlying transport link, if needed. Some transports might not need an explicit teardown (UDP) and some transports may not support it. Remote endpoint of the channel or connection MAY be notified, but this is not guaranteed.
The transport that provides the handle MUST guarantee that Disassociate() could be called arbitrarily many times.
Declaration
[Obsolete("Use the method that states reasons to make sure disassociation reasons are logged.")]
public abstract void Disassociate()
Disassociate(String, ILoggingAdapter)
Closes the underlying transport link, if needed. Some transports might not need an explicit teardown (UDP) and some transports may not support it. Remote endpoint of the channel or connection MAY be notified, but this is not guaranteed.
The transport that provides the handle MUST guarantee that Disassociate() could be called arbitrarily many times.
Declaration
public void Disassociate(string reason, ILoggingAdapter log)
Parameters
Type | Name | Description |
---|---|---|
String | reason | |
ILoggingAdapter | log |
Equals(AssociationHandle)
Declaration
protected bool Equals(AssociationHandle other)
Parameters
Type | Name | Description |
---|---|---|
AssociationHandle | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceWrite(ByteString)
Asynchronously sends the specified payload
to the remote endpoint. This method's implementation MUST be thread-safe
as it might be called from different threads. This method MUST NOT block.
Writes guarantee ordering of messages, but not their reception. The call to write returns with a boolean indicating if the channel was ready for writes or not. A return value of false indicates that the channel is not yet ready for deliver (e.g.: the write buffer is full)and the sender needs to wait until the channel becomes ready again.
Returning false also means that the current write was dropped (this MUST be guaranteed to ensure duplication-free delivery).
Declaration
public abstract bool Write(ByteString payload)
Parameters
Type | Name | Description |
---|---|---|
Google.Protobuf.ByteString | payload | The payload to be delivered to the remote endpoint. |
Returns
Type | Description |
---|---|
Boolean | Bool indicating the availability of the association for subsequent writes. |