NitroWebPorts class final

Registry mapping integer port ids to message handlers — the web analog of the VM's native-port table.

On native, generated code hands ReceivePort.sendPort.nativePort to C, which posts via Dart_PostCObject_DL. On web, C posts through a function-table callback carrying the same int64 port id; the module load path decodes the payload and calls deliver. Pure Dart — unit-testable without a WASM module.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

openCount int
Number of open ports (for tests and leak diagnostics).
no setter

Static Methods

allocate(void handler(dynamic raw)) int
Registers handler and returns its port id.
close(int port) → void
Closes a port. Posts to a closed port are dropped, mirroring Dart_PostCObject on a closed native port.
deliver(int port, dynamic raw) bool
Delivers a decoded message to port's handler. Returns false when the port is closed (message dropped).