This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
/
IConnectionHandler.cs
53 lines (47 loc) · 1.85 KB
/
IConnectionHandler.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
using System;
using System.Collections.Generic;
using Improbable.Gdk.Core.NetworkStats;
namespace Improbable.Gdk.Core
{
/// <inheritdoc />
/// <summary>
/// Represents a handler for a SpatialOS connection.
/// </summary>
public interface IConnectionHandler : IDisposable
{
/// <summary>
/// Gets the worker ID for this worker.
/// </summary>
/// <returns>The worker ID.</returns>
string GetWorkerId();
/// <summary>
/// Gets the worker attributes for this worker.
/// </summary>
/// <returns>The list of worker attributes.</returns>
List<string> GetWorkerAttributes();
/// <summary>
/// Populates the <see cref="ViewDiff"/> object using the messages received since
/// the last time this was called.
/// </summary>
/// <param name="viewDiff">The ViewDiff to populate.</param>
void GetMessagesReceived(ref ViewDiff viewDiff);
/// <summary>
/// Gets the current messages to send container.
/// </summary>
/// <returns>The messages to send container.</returns>
MessagesToSend GetMessagesToSendContainer();
/// <summary>
/// Adds a set of <see cref="MessagesToSend"/> to be sent.
/// </summary>
/// <remarks>
/// The messages may not be sent immediately. This is up to the implementer.
/// </remarks>
/// <param name="messages">The set of messages to send.</param>
void PushMessagesToSend(MessagesToSend messages, NetFrameStats frameStats);
/// <summary>
/// Gets a value indicating whether the underlying connection is connected.
/// </summary>
/// <returns>True if the underlying connection is connected, false otherwise.</returns>
bool IsConnected();
}
}