diff --git a/Contexts/Context.cs b/Contexts/Context.cs index a694da6..4d9ca86 100644 --- a/Contexts/Context.cs +++ b/Contexts/Context.cs @@ -67,11 +67,9 @@ namespace NSspi.Contexts if( disposing ) { - this.Credential.Dispose(); this.ContextHandle.Dispose(); } - this.Disposed = true; } diff --git a/TestClient/ClientForm.cs b/TestClient/ClientForm.cs index 4d7c021..600ce70 100644 --- a/TestClient/ClientForm.cs +++ b/TestClient/ClientForm.cs @@ -186,8 +186,20 @@ namespace TestClient this.initializing = false; this.lastServerToken = null; - this.Invoke( (Action)delegate() + this.BeginInvoke( (Action)delegate() { + this.context.Dispose(); + this.context = new ClientContext( + this.cred, + "", + ContextAttrib.InitIntegrity | + ContextAttrib.ReplayDetect | + ContextAttrib.SequenceDetect | + ContextAttrib.MutualAuth | + ContextAttrib.Delegate | + ContextAttrib.Confidentiality + ); + UpdateButtons(); }); } diff --git a/TestProtocol/CustomServer.cs b/TestProtocol/CustomServer.cs index 89ecf3b..1c762ab 100644 --- a/TestProtocol/CustomServer.cs +++ b/TestProtocol/CustomServer.cs @@ -177,7 +177,8 @@ namespace TestProtocol if( e.SocketErrorCode == SocketError.ConnectionAborted || e.SocketErrorCode == SocketError.Interrupted || e.SocketErrorCode == SocketError.OperationAborted || - e.SocketErrorCode == SocketError.Shutdown ) + e.SocketErrorCode == SocketError.Shutdown || + e.SocketErrorCode == SocketError.ConnectionReset ) { // Shutting down. break; diff --git a/TestServer/ServerForm.cs b/TestServer/ServerForm.cs index 0213fa6..ce87559 100644 --- a/TestServer/ServerForm.cs +++ b/TestServer/ServerForm.cs @@ -63,6 +63,8 @@ namespace TestServer this.connected = false; UpdateButtons(); + + this.usernameTextbox.Text = this.serverCred.Name; } private void Form1_FormClosing( object sender, FormClosingEventArgs e )