SocketTests SendCompressedMessageToServer 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 SendCompressedMessageToServer()
Examples

[Test, Category("Slow")]
public void SendCompressedMessageToServer()
{
    using (var client = CreatedConnectedClient())
    {
        var message = new BigData(new byte[32000]);
        message.Bytes[0] = 5;
        message.Bytes[3458] = 34;
        BigData receivedBigData = null;
        client.DataReceived += o => Console.WriteLine("Received: " + o);
        echoServer.ClientDataReceived += (c, m) =>
        {
            Assert.AreEqual(typeof(BigData), m.GetType());
            receivedBigData = m as BigData;
        };
        client.Send(message);
        Thread.Sleep(100);
        Assert.IsNotNull(receivedBigData);
        Assert.AreEqual(32000, receivedBigData.Bytes.Length);
        Assert.AreEqual(5, receivedBigData.Bytes[0]);
        Assert.AreEqual(0, receivedBigData.Bytes[1]);
        Assert.AreEqual(34, receivedBigData.Bytes[3458]);
    }
}
See Also