TriggerCallbacks() публичный статический Метод

public static TriggerCallbacks ( ) : int
Результат int
Пример #1
0
            /**
             * Dispose the BusListener
             * @param disposing	describes if its activly being disposed
             */
            protected virtual void Dispose(bool disposing)
            {
                if (!_isDisposed)
                {
                    // Dispose of BusAttachment before listeners
                    if (_registeredBus != null)
                    {
                        _registeredBus.Dispose();
                    }

                    Thread destroyThread = new Thread((object o) => {
                        alljoyn_buslistener_destroy(_busListener);
                    });
                    destroyThread.Start();
                    while (destroyThread.IsAlive)
                    {
                        AllJoyn.TriggerCallbacks();
                        Thread.Sleep(0);
                    }

                    _busListener = IntPtr.Zero;
                    main.Free();
                }
                _isDisposed = true;
            }
Пример #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_isDisposed)
     {
         Thread destroyThread = new Thread((object o) => { alljoyn_busobject_destroy(_busObject); });
         destroyThread.Start();
         while (destroyThread.IsAlive)
         {
             AllJoyn.TriggerCallbacks();
             Thread.Sleep(0);
         }
         _busObject = IntPtr.Zero;
     }
     _isDisposed = true;
 }
Пример #3
0
            public QStatus UnbindSessionPort(ushort sessionPort)
            {
                QStatus ret        = QStatus.OK;
                Thread  bindThread = new Thread((object o) => {
                    ret = alljoyn_busattachment_unbindsessionport(_busAttachment, sessionPort);
                });

                bindThread.Start();
                while (bindThread.IsAlive)
                {
                    AllJoyn.TriggerCallbacks();
                    Thread.Sleep(0);
                }
                return(ret);
            }
Пример #4
0
            public QStatus BindSessionPort(ref ushort sessionPort, SessionOpts opts, SessionPortListener listener)
            {
                QStatus ret = QStatus.OK;
                ushort  otherSessionPort = sessionPort;
                Thread  bindThread       = new Thread((object o) => {
                    ret = alljoyn_busattachment_bindsessionport(_busAttachment, ref otherSessionPort,
                                                                opts.UnmanagedPtr, listener.UnmanagedPtr);
                });

                bindThread.Start();
                while (bindThread.IsAlive)
                {
                    AllJoyn.TriggerCallbacks();
                    Thread.Sleep(0);
                }
                sessionPort = otherSessionPort;
                return(ret);
            }
Пример #5
0
            public QStatus JoinSession(string sessionHost, ushort sessionPort, SessionListener listener,
                                       out uint sessionId, SessionOpts opts)
            {
                IntPtr optsPtr           = opts.UnmanagedPtr;
                uint   sessionId_out     = 0;
                int    qstatus           = 0;
                Thread joinSessionThread = new Thread((object o) => {
                    qstatus = alljoyn_busattachment_joinsession(_busAttachment, sessionHost, sessionPort,
                                                                (listener == null ? IntPtr.Zero : listener.UnmanagedPtr), ref sessionId_out, optsPtr);
                });

                joinSessionThread.Start();
                while (joinSessionThread.IsAlive)
                {
                    AllJoyn.TriggerCallbacks();
                    Thread.Sleep(1);
                }

                sessionId = sessionId_out;
                return(qstatus);
            }