Ejemplo n.º 1
0
            public override void RunTestCase(IRemoteObjectAdapterPrx adapter, ITestIntfPrx proxy)
            {
                proxy.StartHeartbeatCount();
                Connection con = proxy.GetConnection() !;

                con.Ping();
                con.Ping();
                con.Ping();
                con.Ping();
                con.Ping();
                proxy.WaitForHeartbeatCount(5);
            }
Ejemplo n.º 2
0
            public override async Task RunTestCaseAsync(IRemoteObjectAdapterPrx adapter, ITestIntfPrx proxy)
            {
                proxy.StartHeartbeatCount();
                Connection con = await proxy.GetConnectionAsync();

                await con.PingAsync();

                await con.PingAsync();

                await con.PingAsync();

                await con.PingAsync();

                await con.PingAsync();

                proxy.WaitForHeartbeatCount(5);
            }
Ejemplo n.º 3
0
            public override async Task RunTestCaseAsync(IRemoteObjectAdapterPrx adapter, ITestIntfPrx proxy)
            {
                Connection?con = proxy.GetCachedConnection();

                TestHelper.Assert(con != null);

                TestHelper.Assert(con.IdleTimeout == TimeSpan.FromSeconds(1));
                TestHelper.Assert(con.KeepAlive == false);

                con.KeepAlive = true;
                TestHelper.Assert(con.KeepAlive == true);

                try
                {
                    con.IdleTimeout = TimeSpan.FromSeconds(1);
                }
                catch
                {
                }

                proxy.StartHeartbeatCount();
                proxy.WaitForHeartbeatCount(2);

                var t1 = new TaskCompletionSource <object?>();
                var t2 = new TaskCompletionSource <object?>();

                con.Closed += (sender, args) => t1.SetResult(null);
                con.Closed += (sender, args) => t2.SetResult(null);

                await con.GoAwayAsync();

                TestHelper.Assert(t1.Task.Result == null);
                TestHelper.Assert(t2.Task.Result == null);

                TestHelper.Assert(!con.IsActive);

                var t3 = new TaskCompletionSource <object?>();

                con.Closed += (sender, args) => t3.SetResult(null);
                TestHelper.Assert(t3.Task.Result == null);

                con.PingReceived += (sender, args) => TestHelper.Assert(false);

                foreach ((int idleTimeout, string keepAlive) in new (int, string)[]