Example #1
0
        public void Initialize()
        {
            const int proxyServer = 22020;
            var       queue       = new QueueConfiguration(2, 100);
            var       connection  = new ConnectionConfiguration("testService", 10);
            var       ndrc2       = new NetReceiverConfiguration(proxyServer, "localhost", "testService");
            var       pcc         = new ProxyCacheConfiguration(TimeSpan.FromSeconds(20));
            var       pccc2       = new ProxyCacheConfiguration(TimeSpan.FromSeconds(40));

            _proxy = new TestProxySystem(new ServerId("localhost", proxyServer),
                                         queue, connection, pcc, pccc2, ndrc2,
                                         new AsyncTasksConfiguration(new TimeSpan()),
                                         new AsyncTasksConfiguration(new TimeSpan()),
                                         new ConnectionTimeoutConfiguration(Consts.OpenTimeout, Consts.SendTimeout));

            _proxy.Build();

            _writer1      = new TestWriterGate();
            _writer2      = new TestWriterGate();
            _distributor1 = new TestDistributorGate();
            _distributor2 = new TestDistributorGate();
        }
Example #2
0
        public void Initialize()
        {
            var common   = new CommonConfiguration(1, 100);
            var distrNet = new DistributorNetConfiguration("localhost",
                                                           distrServer1, distrServer12, "testService", 10);
            var distrConf = new DistributorConfiguration(1, "TestRestore",
                                                         TimeSpan.FromMilliseconds(10000000), TimeSpan.FromMilliseconds(500000), TimeSpan.FromMinutes(100),
                                                         TimeSpan.FromMilliseconds(10000000));

            _distr = new DistributorApi(distrNet, distrConf, common);
            _distr.Build();

            var netconfig = new NetConfiguration("localhost", proxyServer, "testService", 10);
            var toconfig  = new ProxyConfiguration(TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(1),
                                                   TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(10));

            _proxy = new TestGate(netconfig, toconfig, common);
            _proxy.Build();

            _distrTest = new TestDistributorGate();
            _writer1   = new TestWriterGate();
            _writer2   = new TestWriterGate();
            _writer3   = new TestWriterGate();
        }