コード例 #1
0
ファイル: SendMessageTests.cs プロジェクト: wlclass/Photon
        public SendMessageTests()
        {
            var registry = new MessageProcessorRegistry();

            registry.Register(typeof(TestMessageProcessor));
            registry.Register(typeof(TestMessageOneWayProcessor));

            listener = new MessageListener(registry);
            client   = new MessageClient(registry);
        }
コード例 #2
0
ファイル: DisconnectTests.cs プロジェクト: wlclass/Photon
        public async Task ClientDisconnectWaitsForMessages()
        {
            var registry = new MessageProcessorRegistry();

            registry.Register(typeof(DelayedTestProcessor));

            using (var listener = new MessageListener(registry))
                using (var client = new MessageClient(registry)) {
                    listener.Listen(IPAddress.Loopback, Port);
                    await client.ConnectAsync(Host, Port, CancellationToken.None);

                    DelayedTestProcessor.Complete = false;
                    var message = new DelayedTestRequest();
                    var _       = client.Send(message).GetResponseAsync <DelayedTestResponse>();

                    client.Disconnect();
                    //await task;

                    Assert.That(DelayedTestProcessor.Complete, Is.True);

                    listener.Stop();
                }
        }
コード例 #3
0
ファイル: MessageOneWayTest.cs プロジェクト: wlclass/Photon
 public MessageOneWayTests()
 {
     registry = new MessageProcessorRegistry();
     registry.Register(typeof(TestMessageProcessor));
 }