effusion v0.1.0 Effusion.BTP.Peer View Source

Functions for manipulating a member of a BitTorrent swarm.

Link to this section Summary

Functions

Get the handshake message that this peer would send to its remote

Accept a handshake message received by a remote peer, and validate it

Create a new peer data structure

Handle a Peer Wire Protocol (PWP) message, and return the updated peer along with the messages to send back to the remote peer

Set the 20-byte peer ID value that identifies the remote peer

Link to this section Functions

Get the handshake message that this peer would send to its remote.

Accept a handshake message received by a remote peer, and validate it.

Link to this function new(address, peer_id, info_hash, session) View Source

Create a new peer data structure.

Note that the peer_id argument is our local peer ID. To set the ID of the remote peer, see set_remote_peer_id/2.

Handle a Peer Wire Protocol (PWP) message, and return the updated peer along with the messages to send back to the remote peer.

Link to this function set_remote_peer_id(p, remote_peer_id) View Source

Set the 20-byte peer ID value that identifies the remote peer.