Shutdown() public method

Initiates shutdown of current connection and wait to complete it.
public Shutdown ( ) : void
return void
Example #1
0
 public void TestShutdown_TransportShutdownIsInitiated()
 {
     using (var environment = new InProcTestEnvironment())
         using (var target = new RpcClient(_loopbackEndPoint, environment.Configuration, null))
         {
             int isShutdownCompleted = 0;
             target.EnsureConnected();
             target.Transport.ShutdownCompleted += (sender, e) => Interlocked.Exchange(ref isShutdownCompleted, 1);
             target.Shutdown();
             Assert.That(target.Transport.IsClientShutdown);
             Assert.That(isShutdownCompleted, Is.EqualTo(1));
         }
 }
Example #2
0
		public void TestShutdown_TransportShutdownIsInitiated()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null ) )
			{
				int isShutdownCompleted = 0;
				target.EnsureConnected();
				target.Transport.ShutdownCompleted += ( sender, e ) => Interlocked.Exchange( ref isShutdownCompleted, 1 );
				target.Shutdown();
				Assert.That( target.Transport.IsClientShutdown );
				Assert.That( isShutdownCompleted, Is.EqualTo( 1 ) );
			}
		}