-
Notifications
You must be signed in to change notification settings - Fork 0
/
IOscQueryClient.cs
38 lines (23 loc) · 1.17 KB
/
IOscQueryClient.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
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Suhock.Osc;
public interface IOscQueryClient
{
event EventHandler<OscMessage>? MessageReceived;
event EventHandler<OscMessage>? MessageSent;
bool IsRunning { get; }
void Start();
void Send(OscMessage msg);
Task SendAsync(OscMessage msg) => SendAsync(msg, CancellationToken.None);
Task SendAsync(OscMessage msg, CancellationToken cancellationToken);
OscMessage Query(OscMessage msg) => Query(msg, msg.Address, 500);
OscMessage Query(OscMessage msg, int timeout) => Query(msg, msg.Address, 500);
OscMessage Query(OscMessage msg, string responseAddress, int timeout);
Task<OscMessage> QueryAsync(OscMessage msg) => QueryAsync(msg, msg.Address, CancellationToken.None);
Task<OscMessage> QueryAsync(OscMessage msg, CancellationToken cancellationToken) =>
QueryAsync(msg, msg.Address, cancellationToken);
Task<OscMessage> QueryAsync(OscMessage msg, string responseAddress) =>
QueryAsync(msg, responseAddress, CancellationToken.None);
Task<OscMessage> QueryAsync(OscMessage msg, string responseAddress, CancellationToken cancellationToken);
}