TransportImplementations
The TransportImplementations type lists the async connect, disconnect, and sendPacket callbacks a Transport requires to operate.
{
connect?: (receivePacket: (string: string) => Promise<void>) => Promise<void>;
disconnect?: () => Promise<void>;
sendPacket: (string: string) => Promise<void>;
}| Type | Description | |
|---|---|---|
connect? | (receivePacket: (string: string) => Promise<void>) => Promise<void> | The connect callback is invoked when the |
disconnect? | () => Promise<void> | The disconnect 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