A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/richardschneider/net-ipfs-core/commit/f0efcf5 below:

add ping methods; closes #39 · richardschneider/net-ipfs-core@f0efcf5 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+70

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+70

-0

lines changed Original file line number Diff line number Diff line change

@@ -71,5 +71,48 @@ Task<string> ResolveAsync(

71 71

CancellationToken cancel = default(CancellationToken)

72 72

);

73 73 74 +

/// <summary>

75 +

/// Send echo requests to a peer.

76 +

/// </summary>

77 +

/// <param name="peer">

78 +

/// The peer ID to receive the echo requests.

79 +

/// </param>

80 +

/// <param name="count">

81 +

/// The number of echo requests to send. Defaults to 10.

82 +

/// </param>

83 +

/// <param name="cancel">

84 +

/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.

85 +

/// </param>

86 +

/// <returns>

87 +

/// A task that represents the asynchronous operation. The task's value is

88 +

/// the sequence of <see cref="PingResult"/>.

89 +

/// </returns>

90 +

Task<IEnumerable<PingResult>> PingAsync(

91 +

MultiHash peer,

92 +

int count = 10,

93 +

CancellationToken cancel = default(CancellationToken)

94 +

);

95 + 96 +

/// <summary>

97 +

/// Send echo requests to a peer.

98 +

/// </summary>

99 +

/// <param name="address">

100 +

/// The address of a peer to receive the echo requests.

101 +

/// </param>

102 +

/// <param name="count">

103 +

/// The number of echo requests to send. Defaults to 10.

104 +

/// </param>

105 +

/// <param name="cancel">

106 +

/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.

107 +

/// </param>

108 +

/// <returns>

109 +

/// A task that represents the asynchronous operation. The task's value is

110 +

/// the sequence of <see cref="PingResult"/>.

111 +

/// </returns>

112 +

Task<IEnumerable<PingResult>> PingAsync(

113 +

MultiAddress address,

114 +

int count = 10,

115 +

CancellationToken cancel = default(CancellationToken)

116 +

);

74 117

}

75 118

}

Original file line number Diff line number Diff line change

@@ -0,0 +1,27 @@

1 +

using System;

2 +

using System.Collections.Generic;

3 +

using System.Text;

4 + 5 +

namespace Ipfs.CoreApi

6 +

{

7 +

/// <summary>

8 +

/// The result from sending a <see cref="IGenericApi.PingAsync(MultiHash, int, System.Threading.CancellationToken)"/>.

9 +

/// </summary>

10 +

public class PingResult

11 +

{

12 +

/// <summary>

13 +

/// Indicates success or failure.

14 +

/// </summary>

15 +

public bool Success { get; set; }

16 + 17 +

/// <summary>

18 +

/// The round trip time; nano second resolution.

19 +

/// </summary>

20 +

public TimeSpan Time { get; set; }

21 + 22 +

/// <summary>

23 +

/// The text to echo.

24 +

/// </summary>

25 +

public string Text { get; set; }

26 +

}

27 +

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4