public IEnumerator <ITask> SubscribeHandler(pxsonar.Subscribe subscribe)
 {
     yield return(Arbiter.Choice(
                      SubscribeHelper(_subMgrPort, subscribe.Body, subscribe.ResponsePort),
                      delegate(SuccessResult success)
     {
         _subMgrPort.Post(new submgr.Submit(
                              subscribe.Body.Subscriber, dssp.DsspActions.ReplaceRequest, _state, null));
     },
                      delegate(Exception ex) { LogError(ex); }
                      ));
 }
예제 #2
0
 public IEnumerator <ITask> SubscribeHandler(sonar.Subscribe subscribe)
 {
     yield return(Arbiter.Choice(
                      SubscribeHelper(_subMgrPort, subscribe.Body, subscribe.ResponsePort),
                      delegate(SuccessResult success)
     {
         SendNotification <sonar.Replace>(_subMgrPort, subscribe.Body.Subscriber, new sonar.Replace(_state));
     },
                      delegate(Exception fault)
     {
         LogError(fault);
     }
                      ));
 }
예제 #3
0
        public virtual IEnumerator <ITask> SubscribeHandler(pxsonar.Subscribe subscribe)
        {
            SubscribeRequestType request = subscribe.Body;

            LogInfo("Subscribe request from: " + request.Subscriber);

            // Use the Subscription Manager to insert the new subscriber
            yield return(Arbiter.Choice(
                             SubscribeHelper(_submgrPort, request, subscribe.ResponsePort),
                             delegate(SuccessResult success)
            {
                base.SendNotification <Replace>(_submgrPort, request.Subscriber, _state);
            },
                             delegate(Exception e)
            {
                LogError(null, "Subscribe failed", e);
            }
                             ));

            yield break;
        }