Fixed the demo's CustomServer confusion over Disconnected - it was firing it when a full shutdown occurred, not just when the current client disconnected. Created a second Stopped event to track when the full shutdown actually occurs; still not used by UI.

This commit is contained in:
antiduh
2014-06-27 21:59:19 +00:00
parent 7512b11a66
commit 7e5f2a6308

View File

@@ -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 { }
}
}