effusion v0.2.0 Effusion.PWP.ProtocolHandler View Source

Handles Peer Wire Protocol messages.

Link to this section Summary

Functions

Connect to the remote address, expecting the given peer ID.

Break the connection with the given peer.

Disconnect from all peers.

Get the handshake tuple for this connection.

Handle a successful connection.

Handle a peer disconnection.

Handle a Peer Wire Protocol (PWP) message sent by a remote peer.

Validate and handle the given handshake tuple.

Validate and handle the given handshake tuple, expecting a given info hash and peer ID.

Link to this section Functions

Link to this function

connect(address, info_hash, remote_peer_id)

View Source

Connect to the remote address, expecting the given peer ID.

Link to this function

disconnect(info_hash, remote_peer_id, reason)

View Source

Break the connection with the given peer.

Link to this function

disconnect_all(info_hash)

View Source

Disconnect from all peers.

Link to this function

get_handshake(info_hash)

View Source

Get the handshake tuple for this connection.

Link to this function

handle_connect(info_hash, peer_id, arg, extensions)

View Source

Handle a successful connection.

Link to this function

handle_disconnect(info_hash, arg, reason)

View Source

Handle a peer disconnection.

Link to this function

handle_message(info_hash, from, message)

View Source

Handle a Peer Wire Protocol (PWP) message sent by a remote peer.

Validate and handle the given handshake tuple.

Link to this function

recv_handshake(arg, info_hash, expected_peer_id)

View Source

Validate and handle the given handshake tuple, expecting a given info hash and peer ID.