Skip to content

Commit 09c14e3

Browse files
author
Troy Willmot
committed
Fix for incorrect received from endpoint in netcore version.
1 parent 126bca1 commit 09c14e3

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

src/Main/PublishNugetPackage.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
22
echo Press any key to publish
33
pause
4-
".nuget\NuGet.exe" push Rssdp.2.0.0.4.nupkg
4+
".nuget\NuGet.exe" push Rssdp.2.0.0.5.nupkg
55
pause

src/Main/Rssdp.NetCore/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// You can specify all the values or you can default the Build and Revision Numbers
2727
// by using the '*' as shown below:
2828
// [assembly: AssemblyVersion("1.0.*")]
29-
[assembly: AssemblyVersion("2.0.0.3")]
30-
[assembly: AssemblyFileVersion("2.0.0.3")]
29+
[assembly: AssemblyVersion("2.0.0.5")]
30+
[assembly: AssemblyFileVersion("2.0.0.5")]
3131
[assembly: CLSCompliant(false)]
3232
[assembly: NeutralResourcesLanguageAttribute("en-US")]

src/Main/Rssdp.Samples/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ private static async Task SearchForDevicesByUuid()
197197
if (_DevicePublisher == null || !_DevicePublisher.Devices.Any())
198198
{
199199
Console.WriteLine("No devices being published. Use the (P)ublish command first.");
200+
return;
200201
}
201202

202203
var uuid = _DevicePublisher.Devices.First().Uuid;

src/Main/Rssdp.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>Rssdp</id>
5-
<version>2.0.0.4</version>
5+
<version>2.0.0.5</version>
66
<title>Rssdp</title>
77
<authors>Troy Willmot</authors>
88
<owners>Yortw</owners>
@@ -12,7 +12,7 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>Really Simple Service Discovery Protocol - a 100% .Net implementation of the SSDP protocol for publishing custom/basic devices, and discovering all device types on a network.</description>
1414
<summary>A 100% .Net implementation of the SSDP protocol for basic and custom device types.</summary>
15-
<releaseNotes>Events raised from SSDP notification now includes headers.</releaseNotes>
15+
<releaseNotes>Fix for publisher on .Net Core platform.</releaseNotes>
1616
<copyright>Copyright 2016</copyright>
1717
<language>en-AU</language>
1818
<tags>portable xamarin ios android windowsphone winrt uwp mobile ssdp discovery device service protocol upnp netfx40 .net4</tags>

src/Main/Shared/SystemNetSockets/UdpSocket.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ public System.Threading.Tasks.Task<ReceivedUdpData> ReceiveAsync()
5959
state.TaskCompletionSource = tcs;
6060
#if NETSTANDARD1_3
6161
_Socket.ReceiveFromAsync(new System.ArraySegment<Byte>(state.Buffer), System.Net.Sockets.SocketFlags.None, state.EndPoint)
62-
.ContinueWith((task, asyncState) => ProcessResponse(asyncState as AsyncReceiveState, () => task.Result.ReceivedBytes), state);
62+
.ContinueWith((task, asyncState) =>
63+
{
64+
if (task.Status != TaskStatus.Faulted)
65+
{
66+
var receiveState = asyncState as AsyncReceiveState;
67+
receiveState.EndPoint = task.Result.RemoteEndPoint;
68+
ProcessResponse(receiveState, () => task.Result.ReceivedBytes);
69+
}
70+
}, state);
6371
#else
6472
_Socket.BeginReceiveFrom(state.Buffer, 0, state.Buffer.Length, System.Net.Sockets.SocketFlags.None, ref state.EndPoint,
6573
new AsyncCallback((result)=> ProcessResponse(state, () => state.Socket.EndReceiveFrom(result, ref state.EndPoint))), state);

0 commit comments

Comments
 (0)