Messaging StartSession Method Delta Engine Documentation

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

public static MessagingSession StartSession(
	int port
)

Return Value

Type: MessagingSession
Remarks

Tests: DeltaEngine.Networking.Tests.MessagingTests
Examples

1 unit tests call DeltaEngine.Networking.Messaging.StartSession(System.Int32)
[Test, CloseAfterFirstFrame]
public void WhenTwoServersExistMessagesAreSentToTheCorrectOne()
{
    if (!StackTraceExtensions.IsStartedFromNCrunch())
        return; //ncrunch: no coverage
    MessagingSession serverSession2 = Messaging.StartSession(Port + 1);
    MessagingSession clientSession2 = Messaging.JoinSession(Address, Port + 1);
    clientSession.SendMessage("first");
    clientSession2.SendMessage("second");
    Assert.AreEqual("first", serverSession.GetMessages()[0].Data);
    Assert.AreEqual("second", serverSession2.GetMessages()[0].Data);
}
See Also