first pass at binding to multiple network addresses

This commit is contained in:
Luke Pulverenti
2016-12-04 16:55:02 -05:00
parent 598f1cf2bd
commit 8c8f2aaba5
11 changed files with 177 additions and 117 deletions

View File

@@ -17,7 +17,7 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Createa a new unicast socket using the specified local port number.
/// </summary>
IUdpSocket CreateSsdpUdpSocket(int localPort);
IUdpSocket CreateSsdpUdpSocket(IpAddressInfo localIp, int localPort);
/// <summary>
/// Createa a new multicast socket using the specified multicast IP address, multicast time to live and local port.

View File

@@ -10,16 +10,18 @@ namespace MediaBrowser.Model.Net
/// Provides a common interface across platforms for UDP sockets used by this SSDP implementation.
/// </summary>
public interface IUdpSocket : IDisposable
{
/// <summary>
/// Waits for and returns the next UDP message sent to this socket (uni or multicast).
/// </summary>
/// <returns></returns>
Task<SocketReceiveResult> ReceiveAsync();
{
IpAddressInfo LocalIPAddress { get; }
/// <summary>
/// Waits for and returns the next UDP message sent to this socket (uni or multicast).
/// </summary>
/// <returns></returns>
Task<SocketReceiveResult> ReceiveAsync();
/// <summary>
/// Sends a UDP message to a particular end point (uni or multicast).
/// </summary>
Task SendAsync(byte[] buffer, int bytes, IpEndPointInfo endPoint);
}
}
}

View File

@@ -20,5 +20,6 @@ namespace MediaBrowser.Model.Net
/// The <see cref="IpEndPointInfo"/> the data was received from.
/// </summary>
public IpEndPointInfo RemoteEndPoint { get; set; }
}
public IpAddressInfo LocalIPAddress { get; set; }
}
}