PeerHandle class abstract

A discovered peer, together with whatever transport-owned resource is needed to actually connect to it.

Ownership

This type exists to make a use-after-free unrepresentable rather than merely commented.

Continuous discovery re-resolves on a timer and frees the resources from the previous cycle. For LSL those resources are native lsl_streaminfo pointers, so a handle that is still in use when its cycle ends becomes a dangling pointer. The original code avoided this with a bare releaseResource call at the one call site that needed it, guarded only by a comment — and the other call site did it differently.

Now take transfers ownership explicitly, and NetworkStream.addInlet calls it as its first action, so there is no window in which a caller can consume a handle the discovery cycle still believes it owns.

Implemented types
Implementers

Constructors

PeerHandle()

Properties

created → bool
Indicates whether the ILifecycle implementation has been created.
no setterinherited
description → String?
Returns a description of the identity.
no setterinherited
descriptor → PeerDescriptor
What was discovered.
no setter
disposed → bool
Indicates whether the ILifecycle implementation has been disposed.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
Returns a unique identifier for the identity.
no setterinherited
manager → IResourceManager?
gets the resource manager that manages this resource
no setterinherited
name → String
Returns a human-readable name for the identity.
no setterinherited
ownedByDiscovery → bool
Whether the discovery instance still owns (and will free) the underlying resource.
no setter
rawUnsafe → Object?
The transport's private payload — an LSLStreamInfo for LSL, a connection id for a hub transport.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
taken → bool
Whether take has already been called.
no setter
uId → String
Returns a unique identifier that is guaranteed to be globally unique.
no setterinherited

Methods

create() → FutureOr<void>
Creates.
inherited
dispose() → FutureOr<void>
Disposes the ILifecycle implementation, releasing any resources.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
take() → void
Detaches from the discovery manager, transferring ownership to the caller.
toString() → String
A string representation of this object.
inherited
updateManager(IResourceManager? newManager) → FutureOr<void>
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited