Esempio n. 1
0
        void processFindSuccessorForFindSuccessor(IAsyncResult result)
        {
            Console.WriteLine("ChordServer::processFindSuccessorForFindSuccessor ENTER");

            ChordCommon.IChordNode_Object iNode_Object = (ChordCommon.IChordNode_Object)(result.AsyncState);
            IChordNode successor = iNode_Object.node;
            IPAddress  IP        = successor.getIP();

            Stack <Object> recAppState           = (Stack <Object>)(iNode_Object.obj);
            Object         origAppState          = recAppState.Pop();
            AsyncCallback  findSuccessorCallBack = (AsyncCallback)(recAppState.Pop());

            if (findSuccessorCallBack != null)
            {
                ChordCommon.IP_Object _IP_Object = new ChordCommon.IP_Object();

                _IP_Object.IP  = IP;
                _IP_Object.obj = origAppState;

                IAsyncResult res = new ChordCommon.IP_ObjectAsyncResult(_IP_Object, true, true);
                findSuccessorCallBack(res);
            }
        }
Esempio n. 2
0
        void processFindSuccessorForFindSuccessor(IAsyncResult result)
        {
            Console.WriteLine("ChordServer::processFindSuccessorForFindSuccessor ENTER");

            ChordCommon.IChordNode_Object iNode_Object = (ChordCommon.IChordNode_Object)(result.AsyncState);
            IChordNode successor = iNode_Object.node;
            IPAddress IP = successor.getIP();

            Stack<Object> recAppState = (Stack<Object>)(iNode_Object.obj);
            Object origAppState = recAppState.Pop();
            AsyncCallback findSuccessorCallBack = (AsyncCallback)(recAppState.Pop());

            if (findSuccessorCallBack != null)
            {
                ChordCommon.IP_Object _IP_Object = new ChordCommon.IP_Object();

                _IP_Object.IP = IP;
                _IP_Object.obj = origAppState;

                IAsyncResult res = new ChordCommon.IP_ObjectAsyncResult(_IP_Object, true, true);
                findSuccessorCallBack(res);
            }
        }