diff --git a/TestProtocol/CustomServer.cs b/TestProtocol/CustomServer.cs index f5c6af0..4906289 100644 --- a/TestProtocol/CustomServer.cs +++ b/TestProtocol/CustomServer.cs @@ -38,6 +38,8 @@ namespace TestProtocol public event Action Disconnected; + public event Action Stopped; + public void StartServer( int port ) { if( this.running ) @@ -133,13 +135,12 @@ namespace TestProtocol try { - if( this.Disconnected != null ) + if( this.Stopped != null ) { - this.Disconnected(); + this.Stopped(); } } - catch - { } + finally { } } } @@ -208,6 +209,15 @@ namespace TestProtocol } } + + try + { + if( this.Disconnected != null ) + { + this.Disconnected(); + } + } + catch { } } }