diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-03-03 00:53:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-03 00:53:47 -0500 |
| commit | 9f8cbc668db3885f2a30ebf5ca62d2e1de3af98f (patch) | |
| tree | 4a9f055e10fa90384d74a635ca535e3de328f9bd /RSSDP/SsdpCommunicationsServer.cs | |
| parent | 8e1c53aaf482ec89df00066ca827239e5dde3346 (diff) | |
| parent | 7cbc76af27637fca10bca21d0b343f96b1a02b6a (diff) | |
Merge pull request #2504 from MediaBrowser/dev
Dev
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
| -rw-r--r-- | RSSDP/SsdpCommunicationsServer.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index 1f00d5d7c..99e3969aa 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -38,10 +38,10 @@ namespace Rssdp.Infrastructure */ private object _BroadcastListenSocketSynchroniser = new object(); - private IUdpSocket _BroadcastListenSocket; + private ISocket _BroadcastListenSocket; private object _SendSocketSynchroniser = new object(); - private List<IUdpSocket> _sendSockets; + private List<ISocket> _sendSockets; private HttpRequestParser _RequestParser; private HttpResponseParser _ResponseParser; @@ -173,7 +173,7 @@ namespace Rssdp.Infrastructure } } - private async Task SendFromSocket(IUdpSocket socket, byte[] messageData, IpEndPointInfo destination, CancellationToken cancellationToken) + private async Task SendFromSocket(ISocket socket, byte[] messageData, IpEndPointInfo destination, CancellationToken cancellationToken) { try { @@ -189,7 +189,7 @@ namespace Rssdp.Infrastructure } } - private List<IUdpSocket> GetSendSockets(IpAddressInfo fromLocalIpAddress, IpEndPointInfo destination) + private List<ISocket> GetSendSockets(IpAddressInfo fromLocalIpAddress, IpEndPointInfo destination) { EnsureSendSocketCreated(); @@ -348,7 +348,7 @@ namespace Rssdp.Infrastructure ThrowIfDisposed(); } - private IUdpSocket ListenForBroadcastsAsync() + private ISocket ListenForBroadcastsAsync() { var socket = _SocketFactory.CreateUdpMulticastSocket(SsdpConstants.MulticastLocalAdminAddress, _MulticastTtl, SsdpConstants.MulticastPort); @@ -357,9 +357,9 @@ namespace Rssdp.Infrastructure return socket; } - private List<IUdpSocket> CreateSocketAndListenForResponsesAsync() + private List<ISocket> CreateSocketAndListenForResponsesAsync() { - var sockets = new List<IUdpSocket>(); + var sockets = new List<ISocket>(); sockets.Add(_SocketFactory.CreateSsdpUdpSocket(IpAddressInfo.Any, _LocalPort)); @@ -387,7 +387,7 @@ namespace Rssdp.Infrastructure } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capturing task to local variable removes compiler warning, task is not otherwise required.")] - private void ListenToSocket(IUdpSocket socket) + private void ListenToSocket(ISocket socket) { // Tasks are captured to local variables even if we don't use them just to avoid compiler warnings. var t = Task.Run(async () => @@ -397,7 +397,7 @@ namespace Rssdp.Infrastructure { try { - var result = await socket.ReceiveAsync().ConfigureAwait(false); + var result = await socket.ReceiveAsync(CancellationToken.None).ConfigureAwait(false); if (result.ReceivedBytes > 0) { |
