Client IsConnected Property Delta Engine Documentation

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

bool IsConnected { get; }

Property Value

Type: Boolean
Remarks

Tests: DeltaEngine.Networking.Tests.ClientTests
Examples

2 unit tests call DeltaEngine.Networking.Client.IsConnected
[Test]
public void ConnectToServer()
{
    var server = new MockServer();
    using (var client = new MockClient(server))
    {
        client.Connect("localhost", 1);
        Assert.IsTrue(client.IsConnected);
    }
}
[Test]
public void SendTestMessageWithoutServerShouldNotCrash()
{
    using (var client = new MockClient(null))
    {
        Assert.IsFalse(client.IsConnected);
        client.Send(new TextMessage(""));
    }
}
See Also