TransportImplementations
The TransportImplementations type lists the async attach, detach, and sendPacket callbacks a Transport requires to operate.
{
attach?: (receivePacket: (string: string) => Promise<void>) => Promise<void>;
detach?: () => Promise<void>;
sendPacket: (string: string) => Promise<void>;
}| Type | Description | |
|---|---|---|
attach? | (receivePacket: (string: string) => Promise<void>) => Promise<void> | The attach callback is invoked when the |
detach? | () => Promise<void> | The detach callback is invoked when the |
sendPacket | (string: string) => Promise<void> | The sendPacket callback must transmit the provided packet string to remote peers through the underlying communication channel. Packets may be fragments of larger messages depending on the configured fragmentSize. The callback should handle transmission failures gracefully and may queue packets if the channel is not immediately ready. |
Since
v0.0.0