forked from miyu/Dargon.Transport
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIFrameTransmitter.cs
32 lines (30 loc) · 1022 Bytes
/
IFrameTransmitter.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
using System;
namespace Dargon.Transport
{
public interface IFrameTransmitter
{
/// <summary>
/// Begins receiving message frames.
/// </summary>
/// <param name="onFrameReceived">
/// When a message frame is received, this callback is invoked.
/// </param>
void BeginReceivingMessageFrames(Action<byte[]> onFrameReceived);
/// <summary>
/// Sends a raw frame to the remote endpoint
/// </summary>
/// <param name="buffer">
/// The buffer which contains the data we're sending
/// </param>
/// <param name="offset">
/// The offset in the buffer where our entire frame starts
/// </param>
/// <param name="size">
/// The length of the entire frame in our buffer
/// </param>
/// <param name="onFrameSendComplete">
/// This method is invoked when a frame send completes.
/// </param>
void SendRawFrame(byte[] buffer, int offset, int size, Action onFrameSendComplete);
}
}