effusion v0.2.0 Effusion.PWP.ConnectionRegistry View Source

A registry of connected peers and the processes handling them.

Link to this section Summary

Functions

Get all connected processes for the given torrent.

Broadcast a Peer Wire Protocol message to all connected peers.

Send a Peer Wire Protocol message to the given peer.

Check if a peer is connected.

Break all connections for the given torrent.

Get the process ID of the connection with the given peer.

Register the current process as a connection process with the given peer.

Link to this section Functions

Link to this function

all_connected(info_hash)

View Source

Get all connected processes for the given torrent.

Link to this function

btp_broadcast(info_hash, message, peer_id_selector \\ fn _ -> true end)

View Source

Broadcast a Peer Wire Protocol message to all connected peers.

Link to this function

btp_send(info_hash, peer_id, message)

View Source

Send a Peer Wire Protocol message to the given peer.

Link to this function

connected?(info_hash, peer_id)

View Source

Check if a peer is connected.

Link to this function

disconnect_all(info_hash)

View Source

Break all connections for the given torrent.

Link to this function

get_pid(info_hash, peer_id)

View Source

Get the process ID of the connection with the given peer.

Link to this function

register(info_hash, peer_id)

View Source

Register the current process as a connection process with the given peer.