Exemplo n.º 1
0
 private void StopIdentServer( )
 {
     if (0 == Interlocked.Decrement(ref _identServerUseCount))
     {
         _identServer.Stop( );
         _identServer = null;
     }
 }
Exemplo n.º 2
0
        public void Stop_DoNotDisposeListener()
        {
            IdentServer.UserNameNeeded += (s, e) => e.UserName = "******";

            var client   = new TestTcpWrapper();
            var listener = new TestTcpListenerWrapper();

            IdentServer.Start(listener);
            IdentServer.Stop(false);
            Assert.IsFalse(listener.Disposed);
        }
Exemplo n.º 3
0
        public void Stop_DisposeListener()
        {
            IdentServer.UserNameNeeded += (s, e) => e.UserName = "******";

            var client   = new TestTcpWrapper();
            var listener = new TestTcpListenerWrapper();

            IdentServer.Start(listener);
            IdentServer.Stop();
            listener.AddClient(client);
            client.ReceiveLine("0,0");
            Assert.AreEqual(0, client.LinesSent.Count);
            Assert.IsTrue(listener.Disposed);
        }