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:
@@ -38,6 +38,8 @@ namespace TestProtocol
|
|||||||
|
|
||||||
public event Action Disconnected;
|
public event Action Disconnected;
|
||||||
|
|
||||||
|
public event Action Stopped;
|
||||||
|
|
||||||
public void StartServer( int port )
|
public void StartServer( int port )
|
||||||
{
|
{
|
||||||
if( this.running )
|
if( this.running )
|
||||||
@@ -133,13 +135,12 @@ namespace TestProtocol
|
|||||||
|
|
||||||
try
|
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 { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user