Esempio n. 1
0
        static void Main(string[] args)
        {
            var state = 10;

            using (var service = new WebSocketService())
            {
                while (true)
                {
                    PublishState(state, service);
                    PrintState(state);
                    state = ModifyState(state);
                    Thread.Sleep(50 + _rand.Next(50));
                }
            }
            //var stats = StatisticsService.GetStats();
            //Console.WriteLine("Average roundtrip time: {0} ms. Max: {1} ms. Min: {2} ms.", stats.AverageRoundtrip, stats.MaxRoundtrip, stats.MinRoundtrip);
            //Console.ReadKey();
        }
Esempio n. 2
0
 private static void PublishState(int state, WebSocketService service)
 {
     service.Publish(new Message {
         Data = state, SentTimestamp = TimeService.Now, Stats = StatisticsService.GetStats()
     });
 }