diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
| commit | dca78b13411db96366dddfa0d68bb6d36d28ad14 (patch) | |
| tree | 7d41e670f1cadec0db9e1ed7115e151da891f7ea /RSSDP/UdpEndPoint.cs | |
| parent | 597e27d1c6199a40398abb068282711a9cb9db1b (diff) | |
rework dlna project
Diffstat (limited to 'RSSDP/UdpEndPoint.cs')
| -rw-r--r-- | RSSDP/UdpEndPoint.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/RSSDP/UdpEndPoint.cs b/RSSDP/UdpEndPoint.cs new file mode 100644 index 000000000..617769cf4 --- /dev/null +++ b/RSSDP/UdpEndPoint.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rssdp.Infrastructure +{ + /// <summary> + /// Cross platform representation of a UDP end point, being an IP address (either IPv4 or IPv6) and a port. + /// </summary> + public sealed class UdpEndPoint + { + + /// <summary> + /// The IP Address of the end point. + /// </summary> + /// <remarks> + /// <para>Can be either IPv4 or IPv6, up to the code using this instance to determine which was provided.</para> + /// </remarks> + public string IPAddress { get; set; } + + /// <summary> + /// The port of the end point. + /// </summary> + public int Port { get; set; } + + /// <summary> + /// Returns the <see cref="IPAddress"/> and <see cref="Port"/> values separated by a colon. + /// </summary> + /// <returns>A string containing <see cref="IPAddress"/>:<see cref="Port"/>.</returns> + public override string ToString() + { + return (this.IPAddress ?? String.Empty) + ":" + this.Port.ToString(); + } + } +} |
