[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool IPv6AddressCallback(IntPtr ipv6, IntPtr userData);
- [DllImport(Libraries.Connection, EntryPoint = "connection_create_cs")]
- public static extern int Create(int tid, out IntPtr handle);
+ [DllImport(Libraries.Connection, EntryPoint = "connection_create")]
+ public static extern int Create(out IntPtr handle);
- [DllImport(Libraries.Connection, EntryPoint = "connection_destroy_cs")]
- public static extern int Destroy(int tid, IntPtr handle);
+ [DllImport(Libraries.Connection, EntryPoint = "connection_destroy")]
+ public static extern int Destroy(IntPtr handle);
[DllImport(Libraries.Connection, EntryPoint = "connection_get_type")]
public static extern int GetType(IntPtr handle, out int type);
{
_tid = Thread.CurrentThread.ManagedThreadId;
Log.Info(Globals.LogTag, "PInvoke connection_create for Thread " + _tid);
- int ret = Interop.Connection.Create(_tid, out Handle);
+ int ret = Interop.Connection.Create(out Handle);
Log.Info(Globals.LogTag, "Handle: " + Handle);
if(ret != (int)ConnectionError.None)
{
{
Log.Info(Globals.LogTag, "PInvoke connection_destroy for Thread " + _tid);
- Interop.Connection.Destroy(_tid, Handle);
+ Interop.Connection.Destroy(Handle);
if (Handle != IntPtr.Zero)
{
Handle = IntPtr.Zero;
{
if (_ConnectionTypeChanged != null)
{
+ Log.Debug(Globals.LogTag, "ConnectionTypeChanged event");
_ConnectionTypeChanged(null, new ConnectionTypeEventArgs(type));
}
};
{
if (_EthernetCableStateChanged != null)
{
+ Log.Debug(Globals.LogTag, "EthernetCableStateChanged event");
_EthernetCableStateChanged(null, new EthernetCableStateEventArgs(state));
}
};
if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false))
{
+ Log.Debug(Globals.LogTag, "IPAddressChanged event");
_IPAddressChanged(null, new AddressEventArgs(ipv4, ipv6));
}
}
if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false))
{
+ Log.Debug(Globals.LogTag, "ProxyAddressChanged event");
_ProxyAddressChanged(null, new AddressEventArgs(ipv4, ipv6));
}
}