Server NumberOfConnectedClients Property Delta Engine Documentation

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

public int NumberOfConnectedClients { get; }

Property Value

Type: Int32
Remarks

Tests: DeltaEngine.Networking.Tests.ServerTests
Examples

2 unit tests call DeltaEngine.Networking.Server.NumberOfConnectedClients
[Test]
public void InitiallyNoClients()
{
    Assert.AreEqual(0, server.ListenPort);
    Assert.AreEqual(0, server.NumberOfConnectedClients);
}
[Test]
public void ConnectClient()
{
    bool didClientConnect = false;
    server.ClientConnected += client => didClientConnect = true;
    CreateConnectedClient();
    Assert.AreEqual(1, server.NumberOfConnectedClients);
    Assert.IsTrue(didClientConnect);
}
See Also