Class Address
The address specifies the physical location under which an Actor can be reached. Examples are local addresses, identified by the ActorSystem's name, and remote addresses, identified by protocol, host and port.
This class is sealed to allow use as a case class (copy method etc.); if for example a remote transport would want to associate additional information with an address, then this must be done externally.
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public sealed class Address : IEquatable<Address>, IComparable<Address>, IComparable, ISurrogated, ICloneable
Constructors
| Improve this Doc View SourceAddress(String, String, String, Nullable<Int32>)
TBD
Declaration
public Address(string protocol, string system, string host = null, int? port = null)
Parameters
Type | Name | Description |
---|---|---|
String | protocol | TBD |
String | system | TBD |
String | host | TBD |
Nullable<Int32> | port | TBD |
Fields
| Improve this Doc View SourceAllSystems
Pseudo address for all systems
Declaration
public static readonly Address AllSystems
Field Value
Type | Description |
---|---|
Address |
Comparer
An Address comparer. Compares two addresses by their protocol, name, host and port.
Declaration
public static readonly IComparer<Address> Comparer
Field Value
Type | Description |
---|---|
IComparer<Address> |
Properties
| Improve this Doc View SourceHasGlobalScope
Returns true if this Address is usable globally. Unlike locally defined addresses HasLocalScope addresses of global scope are safe to sent to other hosts, as they globally and uniquely identify an addressable entity.
Declaration
public bool HasGlobalScope { get; }
Property Value
Type | Description |
---|---|
Boolean |
HasLocalScope
Returns true if this Address is only defined locally. It is not safe to send locally scoped addresses to remote hosts. See also HasGlobalScope
Declaration
public bool HasLocalScope { get; }
Property Value
Type | Description |
---|---|
Boolean |
Host
TBD
Declaration
public string Host { get; }
Property Value
Type | Description |
---|---|
String |
Port
TBD
Declaration
public int? Port { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
Protocol
TBD
Declaration
public string Protocol { get; }
Property Value
Type | Description |
---|---|
String |
System
TBD
Declaration
public string System { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceClone()
Creates a new copy with the same properties as the current address.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object | A new copy of the current address |
CompareTo(Address)
Compares current address with provided one by their protocol, name, host and port.
Declaration
public int CompareTo(Address other)
Parameters
Type | Name | Description |
---|---|---|
Address | other | Other address to compare with. |
Returns
Type | Description |
---|---|
Int32 |
Equals(Address)
Declaration
public bool Equals(Address other)
Parameters
Type | Name | Description |
---|---|---|
Address | 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 SourceHostPort()
TBD
Declaration
public string HostPort()
Returns
Type | Description |
---|---|
String | TBD |
Parse(String)
Parses a new Address from a given string
Declaration
public static Address Parse(string address)
Parameters
Type | Name | Description |
---|---|---|
String | address | The address to parse |
Returns
Type | Description |
---|---|
Address | A populated Address object with host and port included, if available |
Exceptions
Type | Condition |
---|---|
UriFormatException | Thrown if the address is not able to be parsed |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceToSurrogate(ActorSystem)
Creates a surrogate representation of the current Address.
Declaration
public ISurrogate ToSurrogate(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system that owns this router. |
Returns
Type | Description |
---|---|
ISurrogate | The surrogate representation of the current Address. |
TryParse(ReadOnlySpan<Char>, out Address)
Parses a new Address from a given path
Declaration
public static bool TryParse(ReadOnlySpan<char> span, out Address address)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<Char> | span | The span of address to parse |
Address | address | If |
Returns
Type | Description |
---|---|
Boolean |
|
TryParse(ReadOnlySpan<Char>, out Address, out ReadOnlySpan<Char>)
Parses a new Address from a given path
Declaration
public static bool TryParse(ReadOnlySpan<char> span, out Address address, out ReadOnlySpan<char> absolutUri)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<Char> | span | The span of address to parse |
Address | address | If |
System.ReadOnlySpan<Char> | absolutUri | If |
Returns
Type | Description |
---|---|
Boolean |
|
TryParse(String, out Address)
Parses a new Address from a given path
Declaration
public static bool TryParse(string path, out Address address)
Parameters
Type | Name | Description |
---|---|---|
String | path | The span of address to parse |
Address | address | If |
Returns
Type | Description |
---|---|
Boolean |
|
TryParse(String, out Address, out String)
Parses a new Address from a given path
Declaration
public static bool TryParse(string path, out Address address, out string absolutUri)
Parameters
Type | Name | Description |
---|---|---|
String | path | The span of address to parse |
Address | address | If |
String | absolutUri | If |
Returns
Type | Description |
---|---|
Boolean |
|
WithHost(String)
Creates a new Address with a given host
.
Declaration
public Address WithHost(string host = null)
Parameters
Type | Name | Description |
---|---|---|
String | host | The host used to configure the new address. |
Returns
Type | Description |
---|---|
Address | A new address with the provided |
WithPort(Nullable<Int32>)
Creates a new Address with a given port
.
Declaration
public Address WithPort(int? port = null)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Int32> | port | The port used to configure the new address. |
Returns
Type | Description |
---|---|
Address | A new address with the provided |
WithProtocol(String)
Creates a new Address with a given protocol
.
Declaration
public Address WithProtocol(string protocol)
Parameters
Type | Name | Description |
---|---|---|
String | protocol | The protocol used to configure the new address. |
Returns
Type | Description |
---|---|
Address | A new address with the provided |
WithSystem(String)
Creates a new Address with a given system
.
Declaration
public Address WithSystem(string system)
Parameters
Type | Name | Description |
---|---|---|
String | system | The system used to configure the new address. |
Returns
Type | Description |
---|---|
Address | A new address with the provided |
Operators
| Improve this Doc View SourceEquality(Address, Address)
Compares two specified addresses for equality.
Declaration
public static bool operator ==(Address left, Address right)
Parameters
Type | Name | Description |
---|---|---|
Address | left | The first address used for comparison |
Address | right | The second address used for comparison |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(Address, Address)
Compares two specified addresses for inequality.
Declaration
public static bool operator !=(Address left, Address right)
Parameters
Type | Name | Description |
---|---|---|
Address | left | The first address used for comparison |
Address | right | The second address used for comparison |
Returns
Type | Description |
---|---|
Boolean |
|
Explicit Interface Implementations
| Improve this Doc View SourceIComparable.CompareTo(Object)
Declaration
int IComparable.CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Int32 |