From de78e3d5cb6ba410c6ff9a15f00f7a641b7cc065 Mon Sep 17 00:00:00 2001 From: Martin Kuhn Date: Mon, 13 Jan 2020 11:23:01 +0100 Subject: [PATCH 1/2] fix return value of GetEndpoint() --- source/nanoFramework.System.Net/Sockets/Socket.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/nanoFramework.System.Net/Sockets/Socket.cs b/source/nanoFramework.System.Net/Sockets/Socket.cs index d65457d..835351d 100644 --- a/source/nanoFramework.System.Net/Sockets/Socket.cs +++ b/source/nanoFramework.System.Net/Sockets/Socket.cs @@ -116,8 +116,6 @@ private EndPoint GetEndPoint(bool fLocal) throw new ObjectDisposedException(); } - EndPoint ep = null; - if (m_localEndPoint == null) { m_localEndPoint = new IPEndPoint(IPAddress.Any, 0); @@ -139,7 +137,7 @@ private EndPoint GetEndPoint(bool fLocal) m_localEndPoint = endPoint; } - return ep; + return endPoint; } /// From 9ec01581d2ded096d25afef0ac02bafb305df892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 13 Jan 2020 13:33:37 +0000 Subject: [PATCH 2/2] Update Socket.cs --- source/nanoFramework.System.Net/Sockets/Socket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/nanoFramework.System.Net/Sockets/Socket.cs b/source/nanoFramework.System.Net/Sockets/Socket.cs index 835351d..1534dc6 100644 --- a/source/nanoFramework.System.Net/Sockets/Socket.cs +++ b/source/nanoFramework.System.Net/Sockets/Socket.cs @@ -19,7 +19,7 @@ public class Socket : IDisposable * The m_Handle field MUST be the first field in the Socket class; it is expected by * the SPOT.NET.SocketNative class. */ - // [FieldNoReflection] + // [FieldNoReflection] internal int m_Handle = -1; [Diagnostics.DebuggerBrowsable(Diagnostics.DebuggerBrowsableState.Never)]