Revert "[Tizen.Network.Connection] Init/deinit without ManagedThreadId (#1077)" ...
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 17 Oct 2019 02:29:52 +0000 (11:29 +0900)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2019 02:29:52 +0000 (11:29 +0900)
This reverts commit e26dd691c086517ed96e8986d7dbe27d3bfe4f36.

src/Tizen.Network.Connection/Interop/Interop.Connection.cs
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs

index 50480d3..c0d4a8d 100755 (executable)
@@ -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);
index 713d85d..42301a5 100644 (file)
@@ -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));
                     }
                 }
index 40604d2..a89919e 100755 (executable)
@@ -101,7 +101,6 @@ namespace Tizen.Network.Connection
             {
                 if (_ProfileStateChanged != null)
                 {
-                    Log.Debug(Globals.LogTag, "ProfileStateChanged event");
                     _ProfileStateChanged(null, new ProfileStateEventArgs(state));
                 }
             };