Class MessageNodeWebRtcPeer
java.lang.Object
io.aether.cloud.client.MessageNodeWebRtcPeer
- All Implemented Interfaces:
io.aether.utils.interfaces.Destroyable
WebRTC transport for
MessageNode, ported 1:1 from the TypeScript
implementation (aether_fastmeta_webrtc.ts).
The initiator / answerer roles are chosen by lexicographic comparison of
the two uids. The peer is fully transparent to the caller: once the data
channel opens, send(byte[]) delivers bytes directly, and every
incoming frame is forwarded to onData.
Native dev.onvoid.webrtc types are hidden behind the small
MessageNodeWebRtcPeer.Peer / MessageNodeWebRtcPeer.Channel abstraction so that the negotiation logic can
be exercised in tests without a native WebRTC runtime.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCloud signaling callbacks used by the negotiation. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageNodeWebRtcPeer(UUID localUid, UUID remoteUid, MessageNodeWebRtcPeer.WebRtcSignaling signaling, Consumer<byte[]> onData, Runnable onOpen) -
Method Summary
-
Field Details
-
DISABLE_PROPERTY
Global kill-switch. Tests that assert the ordinary cloud delivery path set this flag so the WebRTC transport does not take precedence over the cloud route. Production code never sets it.- See Also:
-
-
Constructor Details
-
MessageNodeWebRtcPeer
public MessageNodeWebRtcPeer(UUID localUid, UUID remoteUid, MessageNodeWebRtcPeer.WebRtcSignaling signaling, Consumer<byte[]> onData, Runnable onOpen)
-
-
Method Details
-
isSupported
public static boolean isSupported() -
start
public void start() -
isOpen
public boolean isOpen() -
send
public boolean send(byte[] data) -
destroy
public io.aether.utils.futures.AFuture destroy(boolean force) - Specified by:
destroyin interfaceio.aether.utils.interfaces.Destroyable
-