From 9c5243b3abe6ee3b1065bcb60fb216424813c663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 31 May 2019 16:26:07 +0100 Subject: [PATCH] Add remote end point field to Socket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump native version to 1.0.7.0. Signed-off-by: José Simões --- source/nanoFramework.System.Net/Properties/AssemblyInfo.cs | 2 +- source/nanoFramework.System.Net/Sockets/Socket.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/nanoFramework.System.Net/Properties/AssemblyInfo.cs b/source/nanoFramework.System.Net/Properties/AssemblyInfo.cs index 6ff3f1f..a4fe938 100644 --- a/source/nanoFramework.System.Net/Properties/AssemblyInfo.cs +++ b/source/nanoFramework.System.Net/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////// // update this whenever the native assembly signature changes // -[assembly: AssemblyNativeVersion("1.0.6.0")] +[assembly: AssemblyNativeVersion("1.0.7.0")] //////////////////////////////////////////////////////////////// // Setting ComVisible to false makes the types in this assembly not visible diff --git a/source/nanoFramework.System.Net/Sockets/Socket.cs b/source/nanoFramework.System.Net/Sockets/Socket.cs index 2c2fbba..0968ebc 100644 --- a/source/nanoFramework.System.Net/Sockets/Socket.cs +++ b/source/nanoFramework.System.Net/Sockets/Socket.cs @@ -24,6 +24,7 @@ public class Socket : IDisposable private bool m_fBlocking = true; private EndPoint m_localEndPoint = null; + private EndPoint _remoteEndPoint = null; // timeout values are stored in uSecs since the Poll method requires it. private int m_recvTimeout = System.Threading.Timeout.Infinite; @@ -313,6 +314,9 @@ public void Connect(EndPoint remoteEP) throw new ObjectDisposedException(); } + // store remote endpoint we are connecting to + _remoteEndPoint = remoteEP; + NativeSocket.connect(this, remoteEP.Serialize().m_Buffer, !m_fBlocking); if (m_fBlocking)