DCUtRMessage class

DCUtR (Direct Connection Upgrade through Relay) message.

Serialize format: uint8 type + uint16 addr_length (big-endian) + addr_bytes

Per libp2p DCUtR spec, used for NAT hole punching coordination.

Constructors

DCUtRMessage({required int type, required List<int> observedAddr})
Creates a DCUtR message with the given type and observedAddr.

Properties

hashCode int
The hash code for this object.
no setteroverride
observedAddr List<int>
The observed address of the peer, encoded as raw bytes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type int
The message type, either typeConnect or typeSync.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize() Uint8List
Serialize to bytes: uint8 type + uint16 addr_length + addr_bytes.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

parse(Uint8List bytes) DCUtRMessage
Parse from bytes.

Constants

typeConnect → const int
DCUtR CONNECT message type (0x01).
typeSync → const int
DCUtR SYNC message type (0x02).