Example #1
0
        public override void Initialize()
        {
            _logger.Info("Creating live data listener...");
            KxBuffer.StartBuffer();
            lock (KxBuffer.instance.depthFrameReady)
                KxBuffer.instance.depthFrameReady.Add(this.DepthReadyEvent);
            lock (KxBuffer.instance.rgbFrameReady)
                KxBuffer.instance.rgbFrameReady.Add(this.ColorReadyEvent);

            KxBuffer.instance.coordinateMapperReady.WaitOne();
            this.CoordinateMapper = KxBuffer.instance.coordinateMapper;
        }
Example #2
0
 public async static void Start()
 {
     try
     {
         await System.Threading.Tasks.Task.Run(() =>
         {
             _logger.Info("Starting Kinect service...");
             KxBuffer.StartBuffer();
             ServiceHost serviceHost = new ServiceHost(typeof(KxServer));
             serviceHost.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
             serviceHost.AddServiceEndpoint(new UdpDiscoveryEndpoint());
             serviceHost.Open();
             _logger.Info("Kinect listener service!");
             Console.ReadLine();
         }, KxServer._cancallationTokenSrc.Token);
     }
     catch (Exception e)
     {
         _logger.Error(e);
         Stop();
     }
 }