Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    Address
    Implements
    IEquatable<Address>
    IComparable<Address>
    IComparable
    ISurrogated
    ICloneable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public sealed class Address : IEquatable<Address>, IComparable<Address>, IComparable, ISurrogated, ICloneable

    Constructors

    | Edit this page View Source

    Address(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 Source

    AllSystems

    Pseudo address for all systems

    Declaration
    public static readonly Address AllSystems
    Field Value
    Type Description
    Address
    | Edit this page View Source

    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 Source

    HasGlobalScope

    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
    | Edit this page View Source

    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
    | Edit this page View Source

    Host

    TBD

    Declaration
    public string Host { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Port

    TBD

    Declaration
    public int? Port { get; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    Protocol

    TBD

    Declaration
    public string Protocol { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    System

    TBD

    Declaration
    public string System { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Clone()

    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

    | Edit this page View Source

    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
    | Edit this page View Source

    Equals(Address)

    Declaration
    public bool Equals(Address other)
    Parameters
    Type Name Description
    Address other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    HostPort()

    TBD

    Declaration
    public string HostPort()
    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    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

    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    | Edit this page View Source

    ToSurrogate(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.

    | Edit this page View Source

    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 true, the parsed Address. Otherwise null.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    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 true, the parsed Address. Otherwise null.

    ReadOnlySpan<char> absolutUri

    If true, the absolut uri of the path. Otherwise default.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    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 true, the parsed Address. Otherwise null.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    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 true, the parsed Address. Otherwise null.

    string absolutUri

    If true, the absolut uri of the path. Otherwise default.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    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 host.

    | Edit this page View Source

    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 port.

    | Edit this page View Source

    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 protocol.

    | Edit this page View Source

    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 system.

    Operators

    | Edit this page View Source

    operator ==(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

    true if both addresses are equal; otherwise false

    | Edit this page View Source

    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

    true if both addresses are not equal; otherwise false

    Implements

    IEquatable<T>
    IComparable<T>
    IComparable
    ISurrogated
    ICloneable

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET