Create a receiver for a shared P2P session.
The P2P sub-client of a configured Not3Client.
The session id from the share link.
The encryption seed from the share link fragment.
Cancel the transfer, telling the peer about it.
A promise resolving once the abort was attempted.
The file metadata announced by the sender.
A promise resolving once the meta message decrypted, and
rejecting if the transfer fails before that.
Set a hook that is called whenever the transfer progress changes.
The hook to call.
Join the session and receive the file.
The sink for validated, decrypted chunks. Called strictly in order; the returned promise is awaited before the next chunk is read.
How many bytes the sink already holds. Rounded down to the previous chunk boundary.
A promise resolving once the sender confirmed the transfer.
Receives a single file from a P2PSender over a WebRTC data channel.
Every frame is decrypted and sequence-checked as it arrives, so validation finishes the instant the last chunk lands. Failed chunks are re-requested (
nack) and the sender rewinds, which keeps writes strictly sequential — a requirement for streaming sinks. Memory stays bounded: a chunk is written throughsetBytesbefore the next one is processed.On any unrecoverable failure the partial data already handed to
setBytesstays intact; resume by constructing a fresh receiver and passing the validated byte count asresumeOffset.See
P2PSender