Server Dispose Method Delta Engine Documentation

Namespace: DeltaEngine.Networking
Assembly: DeltaEngine.Networking (in DeltaEngine.Networking.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public virtual void Dispose()

Implements

IDisposable Dispose 
Remarks

Tests: DeltaEngine.Networking.Tests.ServerTests
Examples

2 unit tests call DeltaEngine.Networking.Server.Dispose
[Test]
public void DisconnectClient()
{
    bool didClientDisconnect = false;
    server.ClientDisconnected += c => didClientDisconnect = true;
    var client = CreateConnectedClient();
    client.Dispose();
    Assert.IsTrue(didClientDisconnect);
}
[Test]
public void DisconnectServer()
{
    var client = CreateConnectedClient();
    server.Dispose();
    Assert.IsFalse(client.IsConnected);
}
See Also