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
| Edit this page View SourceAddress(string, string, string, int?)
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 |
| int? | port | TBD |
Fields
| Edit this page 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
| Edit this page 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 |
|---|---|
| bool |
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 |
|---|---|
| bool |
Host
TBD
Declaration
public string Host { get; }
Property Value
| Type | Description |
|---|---|
| string |
Port
TBD
Declaration
public int? Port { get; }
Property Value
| Type | Description |
|---|---|
| int? |
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
| Edit this page 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 |
|---|---|
| int |
Equals(Address)
Declaration
public bool Equals(Address other)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page 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
| Edit this page 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 |
|---|---|---|
| ReadOnlySpan<char> | span | The span of address to parse |
| Address | address | If |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|---|
| ReadOnlySpan<char> | span | The span of address to parse |
| Address | address | If |
| ReadOnlySpan<char> | absolutUri | If |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|
| bool |
|
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 |
|---|---|
| bool |
|
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(int?)
Creates a new Address with a given port.
Declaration
public Address WithPort(int? port = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | 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
| Edit this page View Sourceoperator ==(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 |
|---|---|
| bool |
|
operator !=(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 |
|---|---|
| bool |
|
Edit this page