Пример #1
0
        private bool ChangeConnection()
        {
            _statsTimer.Stop();

            using (var formConnect = new FormConnect())
            {
                if (formConnect.ShowDialog() == DialogResult.OK)
                {
                    if (_packeteer != null)
                    {
                        _packeteer.Disconnect();
                    }

                    _connectionInfo = formConnect.GetConnectionInfo();

                    _packeteer = LoginPacketeerFactory.GetNewPacketeer(_connectionInfo);
                    _packeteer.OnMessageReceived  += Packeteer_OnMessageReceived;
                    _packeteer.OnPeerDisconnected += Packeteer_OnPeerDisconnected;

                    RefreshRouteList();

                    _statsTimer.Start();
                    return(true);
                }
            }

            _statsTimer.Start();
            return(false);
        }
Пример #2
0
        public FormRoute(ConnectionInfo connectionInfo, string routeId)
        {
            InitializeComponent();

            _populateRouteInformation = OnPopulateRouteInformation;

            this._routeId = routeId ?? Guid.NewGuid().ToString();
            _packeteer    = LoginPacketeerFactory.GetNewPacketeer(connectionInfo);
            _packeteer.OnMessageReceived += Packeteer_OnMessageReceived;

            var trafficTypes = new List <ComboItem>();

            trafficTypes.Add(new ComboItem("Binary", TrafficType.Binary));
            trafficTypes.Add(new ComboItem("HTTP", TrafficType.Http));
            trafficTypes.Add(new ComboItem("HTTPS", TrafficType.Https));

            comboBoxTrafficType.DisplayMember = "Display";
            comboBoxTrafficType.ValueMember   = "Value";
            comboBoxTrafficType.DataSource    = trafficTypes;

            var bindingProtocol = new List <ComboItem>();

            bindingProtocol.Add(new ComboItem("TCP/IP v4", BindingProtocal.Pv4));
            bindingProtocol.Add(new ComboItem("TCP/IP v6", BindingProtocal.Pv6));

            comboBoxBindingProtocol.DisplayMember = "Display";
            comboBoxBindingProtocol.ValueMember   = "Value";
            comboBoxBindingProtocol.DataSource    = bindingProtocol;

            var connectionPatterns = new List <ComboItem>();

            //connectionPatterns.Add(new ComboItem("Balanced", ConnectionPattern.Balanced)); //Not yet implemented.
            connectionPatterns.Add(new ComboItem("Fail-Over", ConnectionPattern.FailOver));
            connectionPatterns.Add(new ComboItem("Round-Robbin", ConnectionPattern.RoundRobbin));

            comboBoxConnectionPattern.DisplayMember = "Display";
            comboBoxConnectionPattern.ValueMember   = "Value";
            comboBoxConnectionPattern.DataSource    = connectionPatterns;

            ColumnBindingsEnabled.DefaultCellStyle.NullValue    = true;
            ColumnEndpointsEnabled.DefaultCellStyle.NullValue   = true;
            ColumnHTTPHeadersEnabled.DefaultCellStyle.NullValue = true;

            //----------------------------------------------------------------------------
            //Fill in some safe defaults:
            comboBoxTrafficType.SelectedValue        = TrafficType.Http;
            comboBoxBindingProtocol.SelectedValue    = BindingProtocal.Pv4;
            checkBoxListenOnAllAddresses.Checked     = true;
            textBoxInitialBufferSize.Text            = Constants.DefaultInitialBufferSize.ToString();
            textBoxMaxBufferSize.Text                = Constants.DefaultMaxBufferSize.ToString();
            textBoxAcceptBacklogSize.Text            = Constants.DefaultAcceptBacklogSize.ToString();
            comboBoxConnectionPattern.SelectedValue  = ConnectionPattern.RoundRobbin;
            textBoxEncryptionInitTimeout.Text        = Constants.DefaultEncryptionInitilizationTimeoutMs.ToString();
            textBoxStickySessionCacheExpiration.Text = Constants.DefaultStickySessionExpiration.ToString();
            textBoxSpinLockCount.Text                = Constants.DefaultSpinLockCount.ToString();
            checkBoxListenAutoStart.Checked          = true;
            //----------------------------------------------------------------------------
        }
Пример #3
0
        public FormServerSettings(ConnectionInfo connectionInfo)
        {
            InitializeComponent();

            _populateGrid        = OnPopulateGrid;
            this._connectionInfo = connectionInfo;

            _packeteer = LoginPacketeerFactory.GetNewPacketeer(connectionInfo);
            _packeteer.OnMessageReceived += Packeteer_OnMessageReceived;
        }