MsgPack.Rpc.Client.RpcClient.Shutdown C# (CSharp) Method

Shutdown() public method

Initiates shutdown of current connection and wait to complete it.
public Shutdown ( ) : void
return void
		public void Shutdown()
		{
			using ( var task = this.ShutdownAsync() )
			{
				if ( task != null )
				{
					task.Wait();
				}
			}
		}

Usage Example

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));
         }
 }
All Usage Examples Of MsgPack.Rpc.Client.RpcClient::Shutdown