-
Notifications
You must be signed in to change notification settings - Fork 27
/
CreateUdpClient.cs
61 lines (55 loc) · 2.18 KB
/
CreateUdpClient.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
using Bonsai.Osc.Net;
using System.ComponentModel;
namespace Bonsai.Osc
{
/// <summary>
/// Represents an operator that creates an OSC communication channel over UDP.
/// </summary>
[Description("Creates an OSC communication channel over UDP.")]
public class CreateUdpClient : CreateTransport
{
readonly UdpConfiguration configuration;
/// <summary>
/// Initializes a new instance of the <see cref="CreateUdpClient"/> class.
/// </summary>
public CreateUdpClient()
: this(new UdpConfiguration())
{
}
private CreateUdpClient(UdpConfiguration configuration)
: base(configuration)
{
this.configuration = configuration;
}
/// <summary>
/// Gets or sets the local port number from which you intend to communicate.
/// </summary>
[Description("The local port number from which you intend to communicate.")]
public int Port
{
get { return configuration.Port; }
set { configuration.Port = value; }
}
/// <summary>
/// Gets or sets the DNS name of the remote host to which you intend
/// to send data. If empty, the channel will accept connections from any host.
/// </summary>
[Description("The DNS name of the remote host to send data to or receive data from. If empty, the channel will accept connections from any host.")]
public string RemoteHostName
{
get { return configuration.RemoteHostName; }
set { configuration.RemoteHostName = value; }
}
/// <summary>
/// Gets or sets the port number on the remote host to which you intend
/// to send data. If this value is zero, the channel will accept connections
/// from any port.
/// </summary>
[Description("The port number on the remote host to send data to or receive data from. If this value is zero, the channel will accept connections from any port.")]
public int RemotePort
{
get { return configuration.RemotePort; }
set { configuration.RemotePort = value; }
}
}
}