static void HUBReceiver() { char tempMessage; string[] poseInfo; // Receive kursor information HUBNotifierReceiver = new NamedPipesServer(); HUBNotifierReceiver.CreateNewServerPipe(HUBNotifierChannel, NamedPipesServer.PipeDirection.DirectionInOut, NamedPipesServer.SendMode.ByteMode); HUBNotifierReceiver.WaitForConnection(); tempMessage = (char)HUBNotifierReceiver.ReadByte(); HUBNotifierReceiver.WaitForPipeDrain(); HUBNotifierReceiver.Disconnect(); HUBNotifierReceiver.ClosePipe(); if (tempMessage == 'y') { ImageLoader(); } }
static void HUBNotifierReceiver() { Stopwatch HUBNotifierWatcher = new Stopwatch(); HUBNotifierWatcher.Start(); HUBNotifier = new NamedPipesServer(); HUBNotifier.CreateNewServerPipe(HUBNotifierChannel, NamedPipesServer.PipeDirection.DirectionInOut, NamedPipesServer.SendMode.ByteMode); HUBNotifier.WaitForConnection(); if ((char)HUBNotifier.ReadByte() == 'y') { ImageLoader(); } HUBNotifier.WaitForPipeDrain(); HUBNotifier.Disconnect(); HUBNotifier.ClosePipe(); HUBNotifierWatcher.Stop(); HUBReceiverPerformance = HUBNotifierWatcher.ElapsedMilliseconds; }