forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandStatusBase.cs
More file actions
46 lines (41 loc) · 1.37 KB
/
CommandStatusBase.cs
File metadata and controls
46 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Net;
namespace Waher.Networking.Cluster
{
/// <summary>
/// Keeps track of an outgoing command.
/// </summary>
internal abstract class CommandStatusBase
{
public Guid Id;
public IClusterCommand Command;
public byte[] CommandBinary;
public DateTime Timeout;
public DateTime TimeLimit;
public object State;
/// <summary>
/// If all responses have been returned.
/// </summary>
/// <param name="Statuses">Valid statuses.</param>
/// <returns>If all responses have been returned.</returns>
public abstract bool IsComplete(EndpointStatus[] Statuses);
/// <summary>
/// Adds a response from an endpoint.
/// </summary>
/// <param name="From">Endpoint providing response</param>
/// <param name="Response">Response object</param>
public abstract void AddResponse(IPEndPoint From, object Response);
/// <summary>
/// Raises the response event.
/// </summary>
/// <param name="CurrentStatus">Current status of endpoints in cluster.</param>
public abstract void RaiseResponseEvent(EndpointStatus[] CurrentStatus);
/// <summary>
/// Adds an error from an endpoint.
/// </summary>
/// <param name="From">Endpoint providing response</param>
/// <param name="Error">Exception object describing the error.</param>
public abstract void AddError(IPEndPoint From, Exception Error);
}
}