Skip to content

Commit

Permalink
feat(ISwarmApi): connect and disconnect #46
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jan 11, 2018
1 parent 5e25da3 commit c0d5d13
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/CoreApi/ISwarmApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ public interface ISwarmApi
/// A task that represents the asynchronous operation. The task's value
/// is a sequence of <see cref="Peer">Connected Peers</see>.
/// </returns>
Task<IEnumerable<Peer>> PeersAsync(CancellationToken cancel = default(CancellationToken));
Task<IEnumerable<Peer>> PeersAsync(CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Connect to a peer.
/// </summary>
/// <param name="address">
/// An ipfs <see cref="MultiAddress"/>, such as
/// <c>/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ</c>.
/// </param>
/// <param name="cancel">
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
/// </param>
Task ConnectAsync(MultiAddress address, CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Disconnect from a peer.
/// </summary>
/// <param name="address">
/// An ipfs <see cref="MultiAddress"/>, such as
/// <c>/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ</c>.
/// </param>
/// <param name="cancel">
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
/// </param>
Task DisconnectAsync(MultiAddress address, CancellationToken cancel = default(CancellationToken));
}
}

0 comments on commit c0d5d13

Please sign in to comment.