Пример #1
0
            public void beginFixFingers(AsyncCallback beginStabilizeCallBack, Object appState)
            {
                Console.WriteLine("Chord::Engine::beginFixFingers ENTER");
                //static int next = -1;
                fingerNext++;
                if (fingerNext >= 160)
                {
                    fingerNext = 0;
                }
                //bit wise addition is required
                //will require some effort

                byte[] byteVal = getByteArrayOfValue(fingerNext);

                /*		byte[] C = new byte[20];
                 *
                 *
                 *              int bitPos = Int32.MaxValue;
                 *              int bytePos = Math.DivRem(fingerNext - 1,8, out bitPos);
                 *
                 *              C[19-bytePos] = (byte) (1 << bitPos);
                 */

                ObjectInt fingerState = new ObjectInt();

                fingerState.appState = appState;
                fingerState.i        = fingerNext;

                Tashjik.Common.AsyncCallback_Object thisAppState = new Tashjik.Common.AsyncCallback_Object();
                thisAppState.callBack = beginStabilizeCallBack;
                thisAppState.obj      = fingerState;



                AsyncCallback findSuccessorCallBack = new AsyncCallback(processFindSuccessorForFixFingers);

                beginFindSuccessor(Tashjik.Common.UtilityMethod.moduloAdd1(selfNodeBasic.getHashedIP(), byteVal), null, findSuccessorCallBack, thisAppState, new Guid("00000000-0000-0000-0000-000000000000"));
            }
Пример #2
0
 public byte[] getSelfPastryNodeBasicHashedIP()
 {
     return(selfPastryNodeBasic.getHashedIP());
 }