forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HttpxResponseDataEventArgs.cs
87 lines (78 loc) · 2 KB
/
HttpxResponseDataEventArgs.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Waher.Networking.HTTP;
namespace Waher.Networking.XMPP.HTTPX
{
/// <summary>
/// Event handler for HTTPX response data events.
/// </summary>
/// <param name="Sender">Sender of event.</param>
/// <param name="e">Event arguments.</param>
public delegate void HttpxResponseDataEventHandler(object Sender, HttpxResponseDataEventArgs e);
/// <summary>
/// Event arguments for HTTPX data responses.
/// </summary>
public class HttpxResponseDataEventArgs : EventArgs
{
private HttpxResponseEventArgs response;
private byte[] data;
private string streamId;
private bool last;
private object state;
/// <summary>
/// Event arguments for HTTPX data responses.
/// </summary>
/// <param name="Response">Response event arguments.</param>
/// <param name="Data">Data response, possibly partial.</param>
/// <param name="StreamId">Stream ID.</param>
/// <param name="Last">If it is the last data block.</param>
/// <param name="State">State object.</param>
public HttpxResponseDataEventArgs(HttpxResponseEventArgs Response, byte[] Data, string StreamId, bool Last, object State)
: base()
{
this.response = Response;
this.data = Data;
this.streamId = StreamId;
this.last = Last;
this.state = State;
}
/// <summary>
/// HTTPX Response.
/// </summary>
public HttpxResponseEventArgs HttpxResponse
{
get { return this.response; }
}
/// <summary>
/// Data response, possibly partial.
/// </summary>
public byte[] Data
{
get { return this.data; }
}
/// <summary>
/// Stream ID.
/// </summary>
public string StreamId
{
get { return this.streamId; }
}
/// <summary>
/// If it is the last data block.
/// </summary>
public bool Last
{
get { return this.last; }
}
/// <summary>
/// State object passed to the original request.
/// </summary>
public object State
{
get { return this.state; }
}
}
}