Skip to main content

spawn_receive_handler

Function spawn_receive_handler 

Source
pub fn spawn_receive_handler<N: NetworkProvider + 'static>(
    node: Arc<Node<N>>,
    offer_tx: Sender<(FileOffer, OfferResponder)>,
    event_tx: Sender<FileTransferEvent>,
) -> JoinHandle<()>
Expand description

Spawn a background task that listens for incoming file transfer messages.

  • OFFER: Creates a FileOffer + OfferResponder pair, sends them on the offer_tx channel, and waits up to 60 seconds for a decision.
  • PULL_REQUEST: Serves the requested file only if its canonicalized path is inside a configured pull root (see super::FileTransfer::add_pull_root); denied by default.
  • ACCEPT / REJECT: Ignored (handled by send/pull initiators).