示例#1
0
        private void InternalSocketEvent(GLib.SocketClientEvent evnt, GLib.ISocketConnectable connectable, GLib.IOStream connection)
        {
            SocketEventNativeDelegate unmanaged = class_abi.BaseOverride <SocketEventNativeDelegate>(this.LookupGType(), "event");

            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, (int)evnt, connectable == null ? IntPtr.Zero : ((connectable is GLib.Object) ? (connectable as GLib.Object).Handle : (connectable as GLib.SocketConnectableAdapter).Handle), connection == null ? IntPtr.Zero : connection.Handle);
        }
示例#2
0
 protected virtual void OnSocketEvent(GLib.SocketClientEvent evnt, GLib.ISocketConnectable connectable, GLib.IOStream connection)
 {
     InternalSocketEvent(evnt, connectable, connection);
 }
        private void InternalEvent(GLib.SocketClientEvent evnt, GLib.ISocketConnectable connectable, GLib.IOStream connection)
        {
            EventNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("event"));
                unmanaged = (EventNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(EventNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, (int)evnt, connectable == null ? IntPtr.Zero : ((connectable is GLib.Object) ? (connectable as GLib.Object).Handle : (connectable as GLib.SocketConnectableAdapter).Handle), connection == null ? IntPtr.Zero : connection.Handle);
        }
示例#4
0
 public void ConnectAsync(GLib.IOStream connection, GLib.ProxyAddress proxy_address, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
 {
     GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
     cb_wrapper.PersistUntilCalled();
     g_proxy_connect_async(Handle, connection == null ? IntPtr.Zero : connection.Handle, proxy_address == null ? IntPtr.Zero : proxy_address.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
 }
示例#5
0
 public void SpliceAsync(GLib.IOStream stream2, GLib.IOStreamSpliceFlags flags, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
 {
     GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
     cb_wrapper.PersistUntilCalled();
     g_io_stream_splice_async(Handle, stream2 == null ? IntPtr.Zero : stream2.Handle, (int)flags, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
 }