예제 #1
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_timing_out()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test           = new UnacceptedConnectionTest(this);

            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress, timeout: TimeSpan.FromMilliseconds(100));
            test.Run(x =>
            {
                x.UserHandler.ExpectMsg <Tcp.CommandFailed>();
                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }
예제 #2
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_is_unreachable()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test           = new UnacceptedConnectionTest(this);

            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress);
            test.Run(x =>
            {
                //x.ClientSideChannel.Socket.Poll(3000, SelectMode.SelectWrite).ShouldBe(true);  // In .NET we cant select on 'Connectable' (I think)

                Thread.Sleep(3000);
                x.Selector.Send(x.ConnectionActor, SelectionHandler.ChannelConnectable.Instance);
                x.UserHandler.ExpectMsg <Tcp.CommandFailed>();

                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }
예제 #3
0
 public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_timing_out()
 {
     var unboundAddress = TestUtils.TemporaryServerAddress();
     var test = new UnacceptedConnectionTest(this);
     test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress, timeout:TimeSpan.FromMilliseconds(100));
     test.Run(x =>
     {   
         x.UserHandler.ExpectMsg<Tcp.CommandFailed>();
         Watch(x.ConnectionActor);
         ExpectTerminated(x.ConnectionActor);
     });
 }
예제 #4
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_is_unreachable()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test = new UnacceptedConnectionTest(this);
            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress);
            test.Run(x =>
            {
                //x.ClientSideChannel.Socket.Poll(3000, SelectMode.SelectWrite).ShouldBe(true);  // In .NET we cant select on 'Connectable' (I think)

                Thread.Sleep(3000);
                x.Selector.Send(x.ConnectionActor, SelectionHandler.ChannelConnectable.Instance);
                x.UserHandler.ExpectMsg<Tcp.CommandFailed>();

                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }