Пример #1
0
        public void StartStopBusAttachment()
        {
            var bus = new BusAttachment("ServiceTest", true);

            Assert.IsFalse(bus.IsStarted);
            Assert.IsFalse(bus.IsConnected);

            bus.Start();
            Assert.IsTrue(bus.IsStarted);
            Assert.IsFalse(bus.IsConnected);

            bus.Connect();
            Assert.IsTrue(bus.IsConnected);
            Assert.IsFalse(bus.IsStopping);

            Assert.IsFalse(string.IsNullOrEmpty(bus.UniqueName));

            bus.Stop();
            Assert.IsTrue(bus.IsStopping);
            Assert.IsTrue(bus.IsStarted);

            bus.Join();
            Assert.IsFalse(bus.IsStarted);
            Assert.IsFalse(bus.IsConnected);

            bus.Dispose();
        }
Пример #2
0
 private void StopService()
 {
     //TODO
     serviceBus.Stop();
     serviceBus.Join();
     serviceBus.Dispose();
 }
Пример #3
0
        private void StopClient()
        {
            clientBus.AboutAnnounced -= Result_AboutAnnounced;
            Log.WriteLine("AboutListener disposed");

            clientBus.Stop();
            Log.WriteLine("BusAttachment stopped");
            clientBus.Join();
            Log.WriteLine("Join complete");
            clientBus.Dispose();
            Log.WriteLine("BusAttachment disposed");
        }
Пример #4
0
 public void Stop()
 {
     bus.Stop();
     bus.Join();
     bus.Dispose();
 }