예제 #1
0
            public WcfTestClient(IStatistics statistics, TestClientSettings settings)
                : base(statistics, settings)
            {
                _stopwatch.Start();

                _service = new ServerServiceClient(
                    new NetTcpBinding
                    {
                        Security = new NetTcpSecurity
                        {
                            Mode = SecurityMode.None,
                            Transport = new TcpTransportSecurity
                            {
                                ProtectionLevel = ProtectionLevel.None
                            },
                            Message = new MessageSecurityOverTcp
                            {
                                ClientCredentialType = MessageCredentialType.None
                            }
                        }
                        // , TransferMode = TransferMode.Streamed
                    },
                    new EndpointAddress("net.tcp://" + Settings.Host + ":" + Constants.WcfPort + "/ServerService/")
                );

                _service.Open();
            }
예제 #2
0
        protected TestClient(IStatistics statistics, TestClientSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            Statistics = statistics;
            Settings = settings;
        }
예제 #3
0
        internal TestForm(TestClientSettings settings, TestMode mode)
        {
            if (mode == TestMode.ProtoChannel)
                _clientRunner = new ProtoChannelClientRunner(this, settings);
            #if _NET_4
            else
                _clientRunner = new WcfClientRunner(this, settings);
            #endif

            InitializeComponent();
        }
            public ProtoChannelTestClient(IStatistics statistics, TestClientSettings settings)
                : base(statistics, settings)
            {
                _stopwatch.Start();

                _callbackService = new ClientCallbackService();

                _callbackService.StreamReceived += _callbackService_StreamReceived;

                var configuration = new ProtoClientConfiguration
                {
                    CallbackObject = _callbackService
                };

                _service = new ClientService(settings.Host, Constants.ProtoChannelPort, configuration);
            }
 public ProtoChannelClientRunner(IStatistics statistics, TestClientSettings settings)
     : base(statistics, settings)
 {
 }
예제 #6
0
        private void _acceptButton_Click(object sender, EventArgs e)
        {
            if (ValidateChildren())
            {
                ClientMessageType messageType;

                if (_messageSimple.Checked)
                    messageType = ClientMessageType.Simple;
                else if (_messageComplex.Checked)
                    messageType = ClientMessageType.Complex;
                else if (_messageSmallStream.Checked)
                    messageType = ClientMessageType.SmallStream;
                else
                    messageType = ClientMessageType.LargeStream;

                var settings = new TestClientSettings(
                    _host.Text,
                    int.Parse(_concurrentClients.Text),
                    int.Parse(_totalClients.Text),
                    int.Parse(_requestPerClient.Text),
                    messageType
                    );

                using (var form = new TestForm(settings, _modeProtoChannel.Checked ? TestMode.ProtoChannel : TestMode.Wcf))
                {
                    form.ShowDialog(this);
                }
            }
        }
예제 #7
0
 public WcfClientRunner(IStatistics statistics, TestClientSettings settings)
     : base(statistics, settings)
 {
 }