-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathIBinaryTransmission.cs
More file actions
62 lines (57 loc) · 2.63 KB
/
IBinaryTransmission.cs
File metadata and controls
62 lines (57 loc) · 2.63 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Threading.Tasks;
using Waher.Events;
namespace Waher.Networking
{
/// <summary>
/// Interface for binary transmission.
/// </summary>
public interface IBinaryTransmission : IDisposable
{
/// <summary>
/// Sends a binary packet.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Packet">Binary packet.</param>
/// <returns>If data was sent.</returns>
Task<bool> SendAsync(bool ConstantBuffer, byte[] Packet);
/// <summary>
/// Sends a binary packet.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Packet">Binary packet.</param>
/// <param name="Callback">Method to call when packet has been sent.</param>
/// <param name="State">State object to pass on to callback method.</param>
/// <returns>If data was sent.</returns>
Task<bool> SendAsync(bool ConstantBuffer, byte[] Packet, EventHandlerAsync<DeliveryEventArgs> Callback, object State);
/// <summary>
/// Sends a binary packet.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Buffer">Binary Data Buffer</param>
/// <param name="Offset">Start index of first byte written.</param>
/// <param name="Count">Number of bytes written.</param>
/// <returns>If data was sent.</returns>
Task<bool> SendAsync(bool ConstantBuffer, byte[] Buffer, int Offset, int Count);
/// <summary>
/// Sends a binary packet.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Buffer">Binary Data Buffer</param>
/// <param name="Offset">Start index of first byte to write.</param>
/// <param name="Count">Number of bytes to write.</param>
/// <param name="Callback">Method to call when packet has been sent.</param>
/// <param name="State">State object to pass on to callback method.</param>
/// <returns>If data was sent.</returns>
Task<bool> SendAsync(bool ConstantBuffer, byte[] Buffer, int Offset, int Count, EventHandlerAsync<DeliveryEventArgs> Callback, object State);
/// <summary>
/// Flushes any pending or intermediate data.
/// </summary>
/// <returns>If output has been flushed.</returns>
Task<bool> FlushAsync();
}
}