aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/SsdpCommunicationsServer.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-08 02:24:52 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-08 02:24:52 -0500
commitd5c7845917bd15a945aacb92f50db6502123ad9a (patch)
treeb4f9ecfd2d716733ff04406d9360d084ec11cf18 /RSSDP/SsdpCommunicationsServer.cs
parentcf57e8193c5108804724dd55242a56e03b907ed7 (diff)
parent23010f2980381a4b56e05620d4604cafc0e00043 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/Emby
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
-rw-r--r--RSSDP/SsdpCommunicationsServer.cs18
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)
{