From 0506420ab44b76c84353ca60220a8ff802d9481b Mon Sep 17 00:00:00 2001 From: antiduh Date: Thu, 26 Jun 2014 21:56:06 +0000 Subject: [PATCH] Reconstruct the context after it's done. --- TestServer/ServerForm.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/TestServer/ServerForm.cs b/TestServer/ServerForm.cs index 471d8ec..8d53c4b 100644 --- a/TestServer/ServerForm.cs +++ b/TestServer/ServerForm.cs @@ -147,7 +147,19 @@ namespace TestServer this.initializing = true; this.connected = false; - UpdateButtons(); + + this.serverContext.Dispose(); + this.serverContext = new ServerContext( + serverCred, + ContextAttrib.AcceptIntegrity | + ContextAttrib.ReplayDetect | + ContextAttrib.SequenceDetect | + ContextAttrib.MutualAuth | + ContextAttrib.Delegate | + ContextAttrib.Confidentiality + ); + + this.BeginInvoke( (Action) UpdateButtons ); }