Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 01e058e

Browse files
committed
doc(ipfs): update connect and disconnect docs
1 parent 5900684 commit 01e058e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,8 @@ impl<Types: IpfsTypes> Ipfs<Types> {
656656
/// Accepts only multiaddresses with the PeerId to authenticate the connection.
657657
///
658658
/// Returns a future which will complete when the connection has been successfully made or
659-
/// failed for whatever reason.
659+
/// failed for whatever reason. It is possible for this method to return an error, while ending
660+
/// up being connected to the peer by the means of another connection.
660661
pub async fn connect(&self, target: MultiaddrWithPeerId) -> Result<(), Error> {
661662
async move {
662663
let (tx, rx) = oneshot_channel();
@@ -716,6 +717,8 @@ impl<Types: IpfsTypes> Ipfs<Types> {
716717
///
717718
/// At the moment the peer is disconnected by temporarily banning the peer and unbanning it
718719
/// right after. This should always disconnect all connections to the peer.
720+
///
721+
/// Note: this is rarely needed in pratice as connections will time out if left unused.
719722
pub async fn disconnect(&self, target: MultiaddrWithPeerId) -> Result<(), Error> {
720723
async move {
721724
let (tx, rx) = oneshot_channel();

0 commit comments

Comments
 (0)