Search Results for

    Show / Hide Table of Contents

    Class AddressFormatter

    Built-in IAkkaMessagePackFormatter<T> for Address.

    Inheritance
    object
    AddressFormatter
    Implements
    IAkkaMessagePackFormatter<Address>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Serialization.V2
    Assembly: Akka.Serialization.V2.dll
    Syntax
    public sealed class AddressFormatter : IAkkaMessagePackFormatter<Address>
    Remarks

    The wire format is byte-identical to Akka.Remote's hand-rolled Artery control-message serializer (ArteryControlMessageSerializer.WriteAddress / ReadAddress / SizeOfAddress): a 4-element array of [Protocol, System, Host-or-nil, Port-or-nil]. Registering this formatter via AkkaSerializerFormatterAttribute lets Address fields be used on any generated serializer, including ones that must interoperate with that hand-rolled format.

    Methods

    | Edit this page View Source

    Read(ref MessagePackReader)

    Reads a Address value previously written by Write(ref MessagePackWriter, T).

    Declaration
    public Address Read(ref MessagePackReader reader)
    Parameters
    Type Name Description
    MessagePackReader reader

    The MessagePack reader cursor.

    Returns
    Type Description
    Address
    | Edit this page View Source

    SizeOf(Address)

    Returns the exact encoded byte count for value, or UnknownSize when the exact size cannot be cheaply computed.

    Declaration
    public int SizeOf(Address value)
    Parameters
    Type Name Description
    Address value

    The value whose encoded size is being computed.

    Returns
    Type Description
    int
    Remarks

    For transport-sensitive formatters (anything whose encoding consults the thread-static transport context, such as ActorPathFormatter), SizeOf(T) and Write(ref MessagePackWriter, T) read that context independently: both calls must run under the same transport scope on the same thread for the exact-size contract to hold. The generated serializers and the Artery encode path satisfy this naturally by sizing and writing within one serialization scope.

    | Edit this page View Source

    Write(ref MessagePackWriter, Address)

    Writes value to writer.

    Declaration
    public void Write(ref MessagePackWriter writer, Address value)
    Parameters
    Type Name Description
    MessagePackWriter writer

    The MessagePack writer cursor.

    Address value

    The value to write. Never null/absent for non-nullable fields.

    Remarks

    Write MUST produce exactly ONE top-level MessagePack value; wrap multiple values in a single array or map. The generated map framing and the unknown-field forward-compatibility path (reader.Skip()) both depend on one field id mapping to one MessagePack value — multiple top-level values desync older readers during rolling upgrades.

    Implements

    IAkkaMessagePackFormatter<T>

    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