|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
| 3 | +using System.Runtime.CompilerServices; |
3 | 4 | using System.Text; |
4 | 5 | using System.Threading; |
5 | 6 | using System.Threading.Tasks; |
@@ -114,5 +115,49 @@ Task<IEnumerable<PingResult>> PingAsync( |
114 | 115 | int count = 10, |
115 | 116 | CancellationToken cancel = default(CancellationToken) |
116 | 117 | ); |
| 118 | + |
| 119 | +#if ASYNCSTREAM |
| 120 | + /// <summary> |
| 121 | + /// Send echo requests to a peer. |
| 122 | + /// </summary> |
| 123 | + /// <param name="peer"> |
| 124 | + /// The peer ID to receive the echo requests. |
| 125 | + /// </param> |
| 126 | + /// <param name="count"> |
| 127 | + /// The number of echo requests to send. Defaults to 10. |
| 128 | + /// </param> |
| 129 | + /// <param name="cancel"> |
| 130 | + /// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. |
| 131 | + /// </param> |
| 132 | + /// <returns> |
| 133 | + /// An asynchronous stream of <see cref="PingResult"/>. |
| 134 | + /// </returns> |
| 135 | + IAsyncEnumerable<PingResult> Ping( |
| 136 | + MultiHash peer, |
| 137 | + int count = 10, |
| 138 | + CancellationToken cancel = default |
| 139 | + ); |
| 140 | + |
| 141 | + /// <summary> |
| 142 | + /// Send echo requests to a peer. |
| 143 | + /// </summary> |
| 144 | + /// <param name="address"> |
| 145 | + /// The address of a peer to receive the echo requests. |
| 146 | + /// </param> |
| 147 | + /// <param name="count"> |
| 148 | + /// The number of echo requests to send. Defaults to 10. |
| 149 | + /// </param> |
| 150 | + /// <param name="cancel"> |
| 151 | + /// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. |
| 152 | + /// </param> |
| 153 | + /// <returns> |
| 154 | + /// An asynchronous stream of <see cref="PingResult"/>. |
| 155 | + /// </returns> |
| 156 | + IAsyncEnumerable<PingResult> Ping( |
| 157 | + MultiAddress address, |
| 158 | + int count = 10, |
| 159 | + CancellationToken cancel = default |
| 160 | + ); |
| 161 | +#endif |
117 | 162 | } |
118 | 163 | } |
0 commit comments