From 8c8f2aaba5e4bf573efe2730b5450a8c07abe1b3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Dec 2016 16:55:02 -0500 Subject: first pass at binding to multiple network addresses --- MediaBrowser.Model/Net/ISocketFactory.cs | 2 +- MediaBrowser.Model/Net/IUdpSocket.cs | 16 +++++++++------- MediaBrowser.Model/Net/SocketReceiveResult.cs | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'MediaBrowser.Model/Net') diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs index 599292ddf8..ac406e7f12 100644 --- a/MediaBrowser.Model/Net/ISocketFactory.cs +++ b/MediaBrowser.Model/Net/ISocketFactory.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Model.Net /// /// Createa a new unicast socket using the specified local port number. /// - IUdpSocket CreateSsdpUdpSocket(int localPort); + IUdpSocket CreateSsdpUdpSocket(IpAddressInfo localIp, int localPort); /// /// Createa a new multicast socket using the specified multicast IP address, multicast time to live and local port. diff --git a/MediaBrowser.Model/Net/IUdpSocket.cs b/MediaBrowser.Model/Net/IUdpSocket.cs index ef090e010c..c705107266 100644 --- a/MediaBrowser.Model/Net/IUdpSocket.cs +++ b/MediaBrowser.Model/Net/IUdpSocket.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.Model.Net /// Provides a common interface across platforms for UDP sockets used by this SSDP implementation. /// public interface IUdpSocket : IDisposable - { - /// - /// Waits for and returns the next UDP message sent to this socket (uni or multicast). - /// - /// - Task ReceiveAsync(); + { + IpAddressInfo LocalIPAddress { get; } + + /// + /// Waits for and returns the next UDP message sent to this socket (uni or multicast). + /// + /// + Task ReceiveAsync(); /// /// Sends a UDP message to a particular end point (uni or multicast). /// Task SendAsync(byte[] buffer, int bytes, IpEndPointInfo endPoint); - } + } } \ No newline at end of file diff --git a/MediaBrowser.Model/Net/SocketReceiveResult.cs b/MediaBrowser.Model/Net/SocketReceiveResult.cs index 0a2d04ad39..483e2297b9 100644 --- a/MediaBrowser.Model/Net/SocketReceiveResult.cs +++ b/MediaBrowser.Model/Net/SocketReceiveResult.cs @@ -20,5 +20,6 @@ namespace MediaBrowser.Model.Net /// The the data was received from. /// public IpEndPointInfo RemoteEndPoint { get; set; } - } + public IpAddressInfo LocalIPAddress { get; set; } + } } -- cgit v1.2.3