SocketTests ConnectToUnknownHostShouldTimeOut Method Delta Engine Documentation

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

public void ConnectToUnknownHostShouldTimeOut()
Examples

[Test, Category("Slow")]
public void ConnectToUnknownHostShouldTimeOut()
{
    using (var client = new TcpSocket())
    {
        bool isTimedOut = false;
        client.Connect(ServerAddress, 12345, () => isTimedOut = true);
        Assert.IsFalse(isTimedOut);
        Thread.Sleep((int)((client.Timeout + 0.5f) * 1000));
        Assert.IsTrue(isTimedOut);
    }
}
See Also