public static void SubscriberCallback(IAsyncResult ar) { SubscriberDelegate del = (SubscriberDelegate)((AsyncResult)ar).AsyncDelegate; del.EndInvoke(ar); return; }
/// <summary> /// This function must be called before displaying the form. /// </summary> /// <param name="receiver">a ReceiverDelegate for handling output from the AllJoynBusConnection</param> /// <param name="subscribe">a SubscriberDelegate that will handle adding "joiners" to the session"</param> /// <returns></returns> public bool InstallDelegates(ReceiverDelegate receiver, SubscriberDelegate subscribe) { if (_ajBus != null) { _ajBus.SetOutputStream(receiver); _ajBus.SetLocalListener(subscribe); return true; } // else do notning return false; }
/// <summary> /// This function must be called before displaying the form. /// </summary> /// <param name="receiver">a ReceiverDelegate for handling output from the AllJoynBusConnection</param> /// <param name="subscribe">a SubscriberDelegate that will handle adding "joiners" to the session"</param> /// <returns></returns> public bool InstallDelegates(ReceiverDelegate receiver, SubscriberDelegate subscribe) { if (_ajBus != null) { _ajBus.SetOutputStream(receiver); _ajBus.SetLocalListener(subscribe); return(true); } // else do notning return(false); }
private void CleanupSubscriber() { if (_subscriber != null) { _subscriber.View.RemoveFromSuperview(); _subscriber.Delegate = null; _subscriber.Dispose(); _subscriber = null; _subscriberDelegate = null; } }
private void setCallbacks() { if (!_callbacksInstalled) { _receiveDelegate = new ReceiverDelegate(receiveOutput); _joinDelegate = new SubscriberDelegate(sessionSubscriber); GC.KeepAlive(_receiveDelegate); GC.KeepAlive(_joinDelegate); _connectForm.InstallDelegates(_receiveDelegate, _joinDelegate); _callbacksInstalled = true; } }
// private bool _callbacksInstalled = false; private void setCallbacks() { _receiveDelegate = new ReceiverDelegate(receiveOutput); _joinDelegate = new SubscriberDelegate(sessionSubscriber); _queryDelegate = new IncomingQueryDelegate(incomingQuery); _xferDelegate = new IncomingXferDelegate(xferHandler); GC.KeepAlive(_queryDelegate); GC.KeepAlive(_xferDelegate); GC.KeepAlive(_receiveDelegate); GC.KeepAlive(_joinDelegate); }
public static void Unsubscribe(string topic) { Console.WriteLine("Unsubscribing from: " + topic); //broker.Unsubscribe( name, topic ); //SubscriberDelegate del = new SubscriberDelegate( broker.Unsubscribe ); SubscriberDelegate del = new SubscriberDelegate(brokerCircle.Unsubscribe); AsyncCallback remoteCallback = new AsyncCallback(SubscriberCallback); IAsyncResult remAr = del.BeginInvoke(name, topic, remoteCallback, null); Subscriber.topics.Remove(topic); }
private bool setCallbacks() { if (!_callbacksInstalled) { _receiveDelegate = new ReceiverDelegate(receive); _joinDelegate = new SubscriberDelegate(subscribe); GC.KeepAlive(_receiveDelegate); GC.KeepAlive(_joinDelegate); _alljoyn.RemoteStream(_receiveDelegate); _alljoyn.RemoteListener(_joinDelegate); } return(true); }
private void DoSubscribe(OTStream stream) { _subscriberDelegate = new SubscriberDelegate(this); _subscriber = new OTSubscriber(stream, _subscriberDelegate); OTError error; _session.Subscribe(_subscriber, out error); if (error != null) { this.RaiseOnError(error.Description); } }
public static void Subscribe(string topic) { // Console.WriteLine( "Subscribing to: " + topic ); //broker.Subscribe( name, topic ); // No replication //SubscriberDelegate del = new SubscriberDelegate( broker.Subscribe ); // Replication SubscriberDelegate del = new SubscriberDelegate(brokerCircle.Subscribe); AsyncCallback remoteCallback = new AsyncCallback(SubscriberCallback); IAsyncResult remAr = del.BeginInvoke(name, topic, remoteCallback, null); Subscriber.topics.Add(topic); }
public void SetLocalListener(SubscriberDelegate callback) { SetJoinListener(callback); }
public void Unsubscribe(SubscriberDelegate subscriber) { _mutex.EnterWriteLock(); _subscribers.Remove(subscriber); _mutex.ExitWriteLock(); }
public void Subscribe(SubscriberDelegate subscriber) { _mutex.EnterWriteLock(); _subscribers.Add(subscriber); _mutex.ExitWriteLock(); }
private bool setCallbacks() { if (!_callbacksInstalled) { _receiveDelegate = new ReceiverDelegate(receive); _joinDelegate = new SubscriberDelegate(subscribe); GC.KeepAlive(_receiveDelegate); GC.KeepAlive(_joinDelegate); _alljoyn.RemoteStream(_receiveDelegate); _alljoyn.RemoteListener(_joinDelegate); } return true; }
public static extern void SetListener([MarshalAs(UnmanagedType.FunctionPtr)] SubscriberDelegate callBack);
internal void RemoteListener(SubscriberDelegate callback) { SetListener(callback); }
public static void Subscribe( string topic ) { // Console.WriteLine( "Subscribing to: " + topic ); //broker.Subscribe( name, topic ); // No replication //SubscriberDelegate del = new SubscriberDelegate( broker.Subscribe ); // Replication SubscriberDelegate del = new SubscriberDelegate( brokerCircle.Subscribe ); AsyncCallback remoteCallback = new AsyncCallback( SubscriberCallback ); IAsyncResult remAr = del.BeginInvoke( name, topic, remoteCallback, null ); Subscriber.topics.Add(topic); }
public void SetSubscriberMethod(SubscriberDelegate method) { _subMethod = method; }
public static void Unsubscribe( string topic ) { Console.WriteLine( "Unsubscribing from: " + topic ); //broker.Unsubscribe( name, topic ); //SubscriberDelegate del = new SubscriberDelegate( broker.Unsubscribe ); SubscriberDelegate del = new SubscriberDelegate( brokerCircle.Unsubscribe ); AsyncCallback remoteCallback = new AsyncCallback( SubscriberCallback ); IAsyncResult remAr = del.BeginInvoke( name, topic, remoteCallback, null ); Subscriber.topics.Remove(topic); }
private void DoSubscribe(OTStream stream) { _subscriberDelegate = new SubscriberDelegate (this); _subscriber = new OTSubscriber(stream, _subscriberDelegate); OTError error; _session.Subscribe(_subscriber, out error); if (error != null) { this.RaiseOnError(error.Description); } }