From 6aeba507e8560c9364f67ce307b4f2ff56e9a0f6 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 17 Oct 2019 11:29:52 +0900 Subject: [PATCH] Revert "[Tizen.Network.Connection] Init/deinit without ManagedThreadId (#1077)" (#1086) This reverts commit e26dd691c086517ed96e8986d7dbe27d3bfe4f36. --- src/Tizen.Network.Connection/Interop/Interop.Connection.cs | 8 ++++---- .../Tizen.Network.Connection/ConnectionInternalManager.cs | 8 ++------ .../Tizen.Network.Connection/ConnectionProfile.cs | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Tizen.Network.Connection/Interop/Interop.Connection.cs b/src/Tizen.Network.Connection/Interop/Interop.Connection.cs index 50480d3..c0d4a8d 100755 --- a/src/Tizen.Network.Connection/Interop/Interop.Connection.cs +++ b/src/Tizen.Network.Connection/Interop/Interop.Connection.cs @@ -33,11 +33,11 @@ internal static partial class Interop [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool IPv6AddressCallback(IntPtr ipv6, IntPtr userData); - [DllImport(Libraries.Connection, EntryPoint = "connection_create")] - public static extern int Create(out IntPtr handle); + [DllImport(Libraries.Connection, EntryPoint = "connection_create_cs")] + public static extern int Create(int tid, out IntPtr handle); - [DllImport(Libraries.Connection, EntryPoint = "connection_destroy")] - public static extern int Destroy(IntPtr handle); + [DllImport(Libraries.Connection, EntryPoint = "connection_destroy_cs")] + public static extern int Destroy(int tid, IntPtr handle); [DllImport(Libraries.Connection, EntryPoint = "connection_get_type")] public static extern int GetType(IntPtr handle, out int type); diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs index 713d85d..42301a5 100644 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs +++ b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs @@ -35,7 +35,7 @@ namespace Tizen.Network.Connection { _tid = Thread.CurrentThread.ManagedThreadId; Log.Info(Globals.LogTag, "PInvoke connection_create for Thread " + _tid); - int ret = Interop.Connection.Create(out Handle); + int ret = Interop.Connection.Create(_tid, out Handle); Log.Info(Globals.LogTag, "Handle: " + Handle); if(ret != (int)ConnectionError.None) { @@ -60,7 +60,7 @@ namespace Tizen.Network.Connection { Log.Info(Globals.LogTag, "PInvoke connection_destroy for Thread " + _tid); - Interop.Connection.Destroy(Handle); + Interop.Connection.Destroy(_tid, Handle); if (Handle != IntPtr.Zero) { Handle = IntPtr.Zero; @@ -162,7 +162,6 @@ namespace Tizen.Network.Connection { if (_ConnectionTypeChanged != null) { - Log.Debug(Globals.LogTag, "ConnectionTypeChanged event"); _ConnectionTypeChanged(null, new ConnectionTypeEventArgs(type)); } }; @@ -234,7 +233,6 @@ namespace Tizen.Network.Connection { if (_EthernetCableStateChanged != null) { - Log.Debug(Globals.LogTag, "EthernetCableStateChanged event"); _EthernetCableStateChanged(null, new EthernetCableStateEventArgs(state)); } }; @@ -316,7 +314,6 @@ namespace Tizen.Network.Connection if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false)) { - Log.Debug(Globals.LogTag, "IPAddressChanged event"); _IPAddressChanged(null, new AddressEventArgs(ipv4, ipv6)); } } @@ -392,7 +389,6 @@ namespace Tizen.Network.Connection if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false)) { - Log.Debug(Globals.LogTag, "ProxyAddressChanged event"); _ProxyAddressChanged(null, new AddressEventArgs(ipv4, ipv6)); } } diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs index 40604d2..a89919e 100755 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs +++ b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs @@ -101,7 +101,6 @@ namespace Tizen.Network.Connection { if (_ProfileStateChanged != null) { - Log.Debug(Globals.LogTag, "ProfileStateChanged event"); _ProfileStateChanged(null, new ProfileStateEventArgs(state)); } }; -- 2.7.4