///<summary>Inserts one ConnectionGroup into the database.  Returns the new priKey.</summary>
 public static long Insert(ConnectionGroup connectionGroup)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         connectionGroup.ConnectionGroupNum = DbHelper.GetNextOracleKey("connectiongroup", "ConnectionGroupNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(connectionGroup, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     connectionGroup.ConnectionGroupNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(connectionGroup, false));
     }
 }
        ///<summary>Inserts one ConnectionGroup into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ConnectionGroup connectionGroup, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                connectionGroup.ConnectionGroupNum = ReplicationServers.GetKey("connectiongroup", "ConnectionGroupNum");
            }
            string command = "INSERT INTO connectiongroup (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ConnectionGroupNum,";
            }
            command += "Description) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(connectionGroup.ConnectionGroupNum) + ",";
            }
            command +=
                "'" + POut.String(connectionGroup.Description) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                connectionGroup.ConnectionGroupNum = Db.NonQ(command, true, "ConnectionGroupNum", "connectionGroup");
            }
            return(connectionGroup.ConnectionGroupNum);
        }
Beispiel #3
0
    public void SendServerMessageToGroup(NetMessage message, ConnectionGroup group)
    {
        int  messageLength = message.Encode();
        byte error;

        // Send it out
        foreach (ClientData client in clients)
        {
            if (group == ConnectionGroup.lobby && client.inGame)
            {
                continue;
            }
            if (group == ConnectionGroup.game && !client.inGame)
            {
                continue;
            }

            if (client.connectionID == -1)
            {
                if (message.AlsoExecuteOnServer())
                {
                    message.DecodeAndExecute(client);
                }
            }

            NetworkTransport.Send(hostID, client.connectionID, channelID, NetMessage.buffer, messageLength, out error);
        }
    }
        public ConnectionGroupViewModel(
            ConnectionGroup connectionGroup,
            KnownConnections knownConnections,
            ConnectionParameterViewModelFactory connectionParameterViewModelFactory)
        {
            _connectionGroup  = connectionGroup;
            _knownConnections = knownConnections;
            _connectionParameterViewModelFactory = new ConnectionParameterViewModelFactory();

            ConnectionViewModels = new ObservableCollection <ConnectionDescriptionViewModel>(
                connectionGroup.Connections
                .Select(c => new ConnectionDescriptionViewModel(c, this, _knownConnections, new SelectFileView(), _connectionParameterViewModelFactory))
                .ToList());

            GroupViewModels = new ObservableCollection <ConnectionGroupViewModel>(
                connectionGroup.Groups
                .Select(gr => new ConnectionGroupViewModel(gr, knownConnections, _connectionParameterViewModelFactory))
                .ToList());

            ParameterViewModels = connectionGroup.Parameters
                                  .Select(p => connectionParameterViewModelFactory.Create(p))
                                  .ToList();

            Name = connectionGroup.Name;
        }
        ///<summary>Inserts one ConnectionGroup into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(ConnectionGroup connectionGroup, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO connectiongroup (";

            if (!useExistingPK && isRandomKeys)
            {
                connectionGroup.ConnectionGroupNum = ReplicationServers.GetKeyNoCache("connectiongroup", "ConnectionGroupNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "ConnectionGroupNum,";
            }
            command += "Description) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(connectionGroup.ConnectionGroupNum) + ",";
            }
            command +=
                "'" + POut.String(connectionGroup.Description) + "')";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                connectionGroup.ConnectionGroupNum = Db.NonQ(command, true, "ConnectionGroupNum", "connectionGroup");
            }
            return(connectionGroup.ConnectionGroupNum);
        }
        ///<summary>Updates one ConnectionGroup in the database.</summary>
        public static void Update(ConnectionGroup connectionGroup)
        {
            string command = "UPDATE connectiongroup SET "
                             + "Description       = '" + POut.String(connectionGroup.Description) + "' "
                             + "WHERE ConnectionGroupNum = " + POut.Long(connectionGroup.ConnectionGroupNum);

            Db.NonQ(command);
        }
 ///<summary>Returns true if Update(ConnectionGroup,ConnectionGroup) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(ConnectionGroup connectionGroup, ConnectionGroup oldConnectionGroup)
 {
     if (connectionGroup.Description != oldConnectionGroup.Description)
     {
         return(true);
     }
     return(false);
 }
Beispiel #8
0
    void CreateConnections()
    {
        this.connectionGroups = new List <ConnectionGroup>();
        List <dynamic> VertexWeights = new List <dynamic>();
        List <string>  weightFiles   = FileManager.GetWeightFiles(this.tissueInstance);

        this.weightMappings = new List <int>();
        float count = 0f;

        foreach (int key in connectionMappings.Keys)
        {
            int               preNeuron          = connectionMappings[key];
            int[]             postNeurons        = this.ConnectionData.connection_mappings[this.connectionGroups.Count];
            List <GameObject> currentConnections = new List <GameObject>();
            for (int j = 0; j < postNeurons.Length; j++)
            {
                Vector3 preNeuronPos  = new Vector3(this.TissueData.somaPositionArr[preNeuron - 1, 0] + xOffset, this.TissueData.somaPositionArr[preNeuron - 1, 1] + yOffset, this.TissueData.somaPositionArr[preNeuron - 1, 2]);
                Vector3 postNeuronPos = new Vector3(this.TissueData.somaPositionArr[postNeurons[j] - 1, 0] + xOffset, this.TissueData.somaPositionArr[postNeurons[j] - 1, 1] + yOffset, this.TissueData.somaPositionArr[postNeurons[j] - 1, 2]);
                if (preNeuronPos.Equals(postNeuronPos))
                {
                    continue;
                }
                GameObject obj = Instantiate(connection, new Vector3(0f, 0f, 0f), Quaternion.identity);
                obj.GetComponent <Connection>().CreateConnections(1f, preNeuronPos, postNeuronPos);
                currentConnections.Add(obj);
                //Creating for just 1 connection now
                //j = postNeurons.Length;
            }
            ConnectionGroup group = new ConnectionGroup();
            //if (key == 10)
            //    group.CreateConnections(preNeuron, currentConnections, true);
            //else
            //    group.CreateConnections(preNeuron, currentConnections, false);
            group.CreateConnections(preNeuron, currentConnections);

            //int indexOfConnections = connectionFiles[i].IndexOf("/connections")
            string leftPath = weightFiles[this.connectionGroups.Count].Substring(0, weightFiles[this.connectionGroups.Count].IndexOf("\\weights") + 1);
            //string weightSub = shortName.Substring("weights".Length, shortName.Length - ".json".Length - "weights".Length);
            //Will need to modulo against minimum neuron ID
            string fullPath = leftPath + "weights" + (preNeuron % 799).ToString() + ".json";
            Debug.Log("Full path");
            //this.weightMappings.Add(Convert.ToInt32(weightSub));

            WeightInfo info = new WeightInfo(ParseJson(fullPath));
            //this.WeightData.Add(info);
            group.setWeightValues(info);

            //i = weightFiles.Count;
            this.connectionGroups.Add(group);
            count++;
            Constants.connectionsLoaded = count / connectionMappings.Keys.Count;
        }

        this.connectionGroups[0].setActive(true);
    }
Beispiel #9
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<ConnectionGroup> TableToList(DataTable table){
			List<ConnectionGroup> retVal=new List<ConnectionGroup>();
			ConnectionGroup connectionGroup;
			for(int i=0;i<table.Rows.Count;i++) {
				connectionGroup=new ConnectionGroup();
				connectionGroup.ConnectionGroupNum= PIn.Long  (table.Rows[i]["ConnectionGroupNum"].ToString());
				connectionGroup.Description       = PIn.String(table.Rows[i]["Description"].ToString());
				retVal.Add(connectionGroup);
			}
			return retVal;
		}
 public ComponentDescription(string id, string componentName, bool canResize, bool canFlip, double minSize, ComponentProperty[] properties, ConnectionGroup[] connections, RenderDescription[] renderDescriptions, Conditional<FlagOptions>[] flags, ComponentDescriptionMetadata metadata)
 {
     ID = id;
     ComponentName = componentName;
     CanResize = canResize;
     CanFlip = canFlip;
     MinSize = minSize;
     Properties = properties;
     Connections = connections;
     RenderDescriptions = renderDescriptions;
     Flags = flags;
     Metadata = metadata;
 }
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <ConnectionGroup> TableToList(DataTable table)
        {
            List <ConnectionGroup> retVal = new List <ConnectionGroup>();
            ConnectionGroup        connectionGroup;

            foreach (DataRow row in table.Rows)
            {
                connectionGroup = new ConnectionGroup();
                connectionGroup.ConnectionGroupNum = PIn.Long(row["ConnectionGroupNum"].ToString());
                connectionGroup.Description        = PIn.String(row["Description"].ToString());
                retVal.Add(connectionGroup);
            }
            return(retVal);
        }
Beispiel #12
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            ConnectionGroup connGroup = new ConnectionGroup();

            connGroup.Description        = "Group";   //in case they close the window without clicking ok
            connGroup.ConnectionGroupNum = ConnectionGroups.Insert(connGroup);
            connGroup.IsNew = true;
            FormCentralConnectionGroupEdit FormCCGE = new FormCentralConnectionGroupEdit();

            FormCCGE.ConnectionGroupCur = connGroup;
            FormCCGE.ShowDialog();
            //if cancel, deleted inside
            FillGrid();
        }
 ///<summary>Inserts one ConnectionGroup into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(ConnectionGroup connectionGroup)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(connectionGroup, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             connectionGroup.ConnectionGroupNum = DbHelper.GetNextOracleKey("connectiongroup", "ConnectionGroupNum");                  //Cacheless method
         }
         return(InsertNoCache(connectionGroup, true));
     }
 }
        private void menuGroups_Click(object sender, EventArgs e)
        {
            ConnectionGroup connGroupCur = null;

            if (comboConnectionGroups.SelectedIndex > 0)
            {
                connGroupCur = _listConnectionGroups[comboConnectionGroups.SelectedIndex - 1];
            }
            FormCentralConnectionGroups FormCCG = new FormCentralConnectionGroups();

            FormCCG.ShowDialog();
            ConnectionGroups.RefreshCache();
            FillComboGroups(connGroupCur == null ? 0 : connGroupCur.ConnectionGroupNum);          //Reselect the connection group that the user had before.
            FillGrid();
        }
Beispiel #15
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)             //Do nothing
     {
         DialogResult = DialogResult.Cancel;
     }
     //Deletion is permanent.  Remove all groupattaches for this group then Set ConnectionGroupCur to null so parent form knows to remove it.
     if (MessageBox.Show(this, Lans.g(this, "Delete this entire connection group?"), "", MessageBoxButtons.YesNo) == DialogResult.No)
     {
         return;
     }
     for (int i = 0; i < _listConnGroupAttaches.Count; i++)
     {
         ConnGroupAttaches.Delete(_listConnGroupAttaches[i].ConnGroupAttachNum);
     }
     ConnectionGroupCur = null;
     DialogResult       = DialogResult.OK;
 }
        public void GenerateXmlConnectionGroup(string versionId, string displayName, string priority, string pathToSave = "")
        {
            if (!PackagesList.Any())
            {
                return;
            }

            ConnectionGroup = new ConnectionGroup(versionId, displayName, priority);

            XNamespace appvNamespace = ConnectionGroup.SchemaName;

            XDocument connectionGroup = new XDocument(
                new XDeclaration("1.0", "utf-16", "yes"),
                new XElement(
                    appvNamespace + "AppConnectionGroup",
                    new XAttribute("xmlns", ConnectionGroup.SchemaName),
                    new XAttribute(XNamespace.Xmlns + "appv", ConnectionGroup.SchemaName),
                    new XAttribute("AppConnectionGroupId", ConnectionGroup.AppConnectionGroupdId),
                    new XAttribute("VersionId", ConnectionGroup.VersionId),
                    new XAttribute("Priority", ConnectionGroup.Priority),
                    new XAttribute("DisplayName", ConnectionGroup.DisplayName),
                    new XElement(
                        appvNamespace + "Packages",
                        from package in PackagesList select new XElement(
                            appvNamespace + "Package",
                            new XAttribute("DisplayName", package.DisplayName),
                            new XAttribute("PackageId", package.PackageId),
                            new XAttribute("VersionId", package.VersionId)
                            )
                        )
                    )
                );

            if (pathToSave == String.Empty)
            {
                pathToSave =
                    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                                 ConnectionGroup.DisplayName + ".xml");
            }
            connectionGroup.Save(pathToSave);
            PowerShellScript = GeneratePowerShellScriptForPublishing(pathToSave);
            CleanUp();
        }
        private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e)
        {
            ConnectionGroup connGroup = _listCentralConnGroups[gridMain.SelectedIndices[0]].Copy();          //Making copy so if they press cancel any changes won't persist.
            FormCentralConnectionGroupEdit FormCCGE = new FormCentralConnectionGroupEdit();

            FormCCGE.ConnectionGroupCur = connGroup;
            FormCCGE.ShowDialog();
            if (FormCCGE.DialogResult == DialogResult.OK)
            {
                if (FormCCGE.ConnectionGroupCur == null)               //Group was deleted in child window, remove it from list. (Deletion is also DialogResult.OK)
                {
                    _listCentralConnGroups.RemoveAt(gridMain.SelectedIndices[0]);
                }
                else                 //Child window potentially updated the connection group, replace old version in list with current version.
                {
                    _listCentralConnGroups[gridMain.SelectedIndices[0]] = FormCCGE.ConnectionGroupCur;
                }
            }
            FillGrid();
        }
Beispiel #18
0
        public TransportGroupRouter(IConnectionTransporter transporter, TransportRouterConfig config)
        {
            _transporter = transporter;
            _config      = config;

            var groupIds = config.Groups.Keys.ToList();

            _groups = new ArrayDictionary <TransportGroupId, ConnectionGroup>(config.Groups.Count);
            for (int i = 0; i < groupIds.Count; i++)
            {
                var groupId     = groupIds[i];
                var groupConfig = config.Groups[groupId];
                _groups[groupId] = new ConnectionGroup(groupId, maxConnections: groupConfig.MaxConnections);
            }
            _dataHandlers = new ArrayDictionary <TransportGroupId, ITransportDataHandler>(config.Groups.Count);

            transporter.OnConnectionOpened += OnConnectionEstablished;
            transporter.OnConnectionClosed += OnDisconnected;
            transporter.OnDataReceived     += OnDataReceived;
        }
        ///<summary>Updates one ConnectionGroup in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(ConnectionGroup connectionGroup, ConnectionGroup oldConnectionGroup)
        {
            string command = "";

            if (connectionGroup.Description != oldConnectionGroup.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = '" + POut.String(connectionGroup.Description) + "'";
            }
            if (command == "")
            {
                return(false);
            }
            command = "UPDATE connectiongroup SET " + command
                      + " WHERE ConnectionGroupNum = " + POut.Long(connectionGroup.ConnectionGroupNum);
            Db.NonQ(command);
            return(true);
        }
        private ConnectionGroup ReadGroup(GroupElement groupElement)
        {
            var connectionGroup = new ConnectionGroup
            {
                Name = groupElement.groupName,
            };

            PatchCommonParameters(connectionGroup.Parameters,
                                  () => groupElement.defaultHost, () => groupElement.defaultPort,
                                  () => groupElement.defaultUsername, () => groupElement.defaultPassword);

            foreach (var item in groupElement.servers)
            {
                var connection = ReadConnection((ServerElement)item);
                if (connection != null)
                {
                    connectionGroup.Connections.Add(connection);
                }
            }
            return(connectionGroup);
        }
Beispiel #21
0
		///<summary>Inserts one ConnectionGroup into the database.  Provides option to use the existing priKey.</summary>
		public static long Insert(ConnectionGroup connectionGroup,bool useExistingPK){
			if(!useExistingPK && PrefC.RandomKeys) {
				connectionGroup.ConnectionGroupNum=ReplicationServers.GetKey("connectiongroup","ConnectionGroupNum");
			}
			string command="INSERT INTO connectiongroup (";
			if(useExistingPK || PrefC.RandomKeys) {
				command+="ConnectionGroupNum,";
			}
			command+="Description) VALUES(";
			if(useExistingPK || PrefC.RandomKeys) {
				command+=POut.Long(connectionGroup.ConnectionGroupNum)+",";
			}
			command+=
				 "'"+POut.String(connectionGroup.Description)+"')";
			if(useExistingPK || PrefC.RandomKeys) {
				Db.NonQ(command);
			}
			else {
				connectionGroup.ConnectionGroupNum=Db.NonQ(command,true);
			}
			return connectionGroup.ConnectionGroupNum;
		}
Beispiel #22
0
		///<summary>Inserts one ConnectionGroup into the database.  Returns the new priKey.</summary>
		public static long Insert(ConnectionGroup connectionGroup){
			if(DataConnection.DBtype==DatabaseType.Oracle) {
				connectionGroup.ConnectionGroupNum=DbHelper.GetNextOracleKey("connectiongroup","ConnectionGroupNum");
				int loopcount=0;
				while(loopcount<100){
					try {
						return Insert(connectionGroup,true);
					}
					catch(Oracle.DataAccess.Client.OracleException ex){
						if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
							connectionGroup.ConnectionGroupNum++;
							loopcount++;
						}
						else{
							throw ex;
						}
					}
				}
				throw new ApplicationException("Insert failed.  Could not generate primary key.");
			}
			else {
				return Insert(connectionGroup,false);
			}
		}
        private void butAdd_Click(object sender, EventArgs e)
        {
            ConnectionGroup connGroup = new ConnectionGroup();

            connGroup.Description        = "";
            connGroup.ConnectionGroupNum = ConnectionGroups.Insert(connGroup);
            FormCentralConnectionGroupEdit FormCCGE = new FormCentralConnectionGroupEdit();

            FormCCGE.ConnectionGroupCur = connGroup;
            FormCCGE.IsNew = true;
            FormCCGE.ShowDialog();
            if (FormCCGE.DialogResult == DialogResult.OK)
            {
                if (FormCCGE.ConnectionGroupCur == null)
                {
                    ConnectionGroups.Delete(connGroup.ConnectionGroupNum);
                }
                else
                {
                    _listCentralConnGroups.Add(connGroup);
                }
            }
            FillGrid();
        }
Beispiel #24
0
		///<summary>Updates one ConnectionGroup in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(ConnectionGroup connectionGroup,ConnectionGroup oldConnectionGroup){
			string command="";
			if(connectionGroup.Description != oldConnectionGroup.Description) {
				if(command!=""){ command+=",";}
				command+="Description = '"+POut.String(connectionGroup.Description)+"'";
			}
			if(command==""){
				return false;
			}
			command="UPDATE connectiongroup SET "+command
				+" WHERE ConnectionGroupNum = "+POut.Long(connectionGroup.ConnectionGroupNum);
			Db.NonQ(command);
			return true;
		}
Beispiel #25
0
		///<summary>Updates one ConnectionGroup in the database.</summary>
		public static void Update(ConnectionGroup connectionGroup){
			string command="UPDATE connectiongroup SET "
				+"Description       = '"+POut.String(connectionGroup.Description)+"' "
				+"WHERE ConnectionGroupNum = "+POut.Long(connectionGroup.ConnectionGroupNum);
			Db.NonQ(command);
		}
Beispiel #26
0
 /// <summary>
 /// Sets the <paramref name="connectionGroup"/> used by the analytics methods.
 /// </summary>
 /// <param name="connectionGroup">
 /// The connection group.
 /// </param>
 public void SetAnalyticsConnectionGroup(ConnectionGroup connectionGroup)
 {
     this._analyticsConnectionGroup = connectionGroup;
 }
Beispiel #27
0
        public FdfsConnection GetConnection(LinkType link,IPEndPoint remoteEP)
        {
            Dictionary<IPEndPoint, ConnectionGroup> groups = GetGroup(link);
            FdfsConnection conn = null;

            lock (_syncRoot)
            {
                ConnectionGroup group = null;
                if (groups.TryGetValue(remoteEP, out group))
                {
                    conn = group.GetOne();
                }
                else
                {
                    group = new ConnectionGroup(this, remoteEP,link);
                    conn = group.GetOne();
                    groups.Add(remoteEP, group);
                }
            }
            LogUtil.Info(string.Format("FdfsConnection GetConnection(LinkType {0},IPEndPoint {1}) port:{2} connect {3}",link.ToString(), remoteEP.Address, remoteEP.Port, conn.IsConnected.ToString()));
            return conn;
        }
Beispiel #28
0
        // groupTracks: [defaultgroup: "121.199.21.50:22122,121.199.21.53:22122"]
        public void Initialize(Hashtable groupTracks, Hashtable groupStroages)
        {
            if (!_inited)
            {
                LogUtil.Info(string.Format("ConnectionManager.Initialize: start"));
                _groupsTracker = new Dictionary<IPEndPoint, ConnectionGroup>();
                _groupsStorages = new Dictionary<IPEndPoint, ConnectionGroup>();

                string[] storages = groupStroages["DefaultGroup"].ToString().Split(new char[] { ',' });

                foreach (string s in storages)
                {
                    string[] ss = s.Split(':');
                    IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(ss[0]), int.Parse(ss[1]));
                    ConnectionGroup group = new ConnectionGroup(this,endPoint,LinkType.Storages);
                    this._groupsStorages.Add(endPoint, group);
                }
                _storagesNum = storages.Length;

                string[] tracker = groupTracks["DefaultGroup"].ToString().Split(new char[] { ',' });
                foreach (string s in tracker)
                {
                    string[] ss = s.Split(':');
                    IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(ss[0]), int.Parse(ss[1]));
                    ConnectionGroup group = new ConnectionGroup(this, endPoint,LinkType.Tracker);
                    this._groupsTracker.Add(endPoint, group);
                }
                _trackerNum = tracker.Length;
                _inited = true;

                //FdfsPerfCounter.Instance.NumberOfConnectionGroupTracker.SetRawValue(_trackerNum);
                //FdfsPerfCounter.Instance.NumberOfConnectionGroupStorages.SetRawValue(_storagesNum);
            }

            LogUtil.Info(string.Format("ConnectionManager.Initialize has init"));
        }
Beispiel #29
0
 public FdfsConnection(ConnectionGroup group,Socket socket)
 {
     _group = group;
     InitSocket(socket);
     _stream = new BufferedStream(new NetworkStream(_socket, false));
 }
Beispiel #30
0
 public Network(ConnectionGroup con)
 {
     this.con = con;
 }
Beispiel #31
0
 public EntanglementProviderContext(ICommon host)
 {
     Host   = host;
     Sender = null;
     All    = new ConnectionGroup(host);
 }
Beispiel #32
0
 /// <summary>
 /// Adds a <paramref name="connectionGroup"/> to the hash ring.
 /// </summary>
 /// <param name="connectionGroup">
 /// The connection group.
 /// </param>
 public void AddRedisConnectionGroup(ConnectionGroup connectionGroup)
 {
     this._consistentHashRing.Add(connectionGroup);
 }
Beispiel #33
0
 /// <summary>
 /// Removes a <paramref name="connectionGroup"/> to the hash ring.
 /// </summary>
 /// <param name="connectionGroup">
 /// The connection group.
 /// </param>
 public void RemoveRedisConnectionGroup(ConnectionGroup connectionGroup)
 {
     this._consistentHashRing.Remove(connectionGroup);
 }
Beispiel #34
0
 ///<summary>Inserts one ConnectionGroup into the database.  Returns the new priKey.</summary>
 public static long Insert(ConnectionGroup connectionGroup)
 {
     return(Insert(connectionGroup, false));
 }