Beispiel #1
0
    public static void Main(string[] args)
    {
        using (var manager = new RtcManager(args))
        {
            var comp = manager.GetComponent("ConsoleOut0.rtc");

            var obs = comp.StateChangedAsObservable()
              .Where(state => state.State == LifeCycleState.ACTIVE_STATE)
              .PublishLast();

            obs.Connect();

            var ret = comp.ActivateAsync().Result;

            //obs.First();

            obs.Timeout(TimeSpan.FromSeconds(5))
              .Catch((TimeoutException ex) => {
                // 例外処理
                return Observable.Empty<StateChangedEventArgs>();
              })
              .First();

        }
    }
Beispiel #2
0
    public static void Main(string[] args)
    {
        using (var manager = new RtcManager("localhost", 2809))
        {
            var comp = manager.GetComponent("ConsoleIn0.rtc");

            var prof = comp.GetStateAsync().First();
            Console.WriteLine(prof);
        }

        //var inport = new ReactiveInPort<TimedLong>("test");

        //inport.Subscribe(x => Console.WriteLine(x.data));

        //inport.ConnectAsync("ConsoleIn.rtc:ConsoleIn.out");
    }