public IP_ObjectAsyncResult(IP_Object n, bool compSync, bool isComp) { AsyncState = (Object)n; AsyncWaitHandle = null; // CompletedSynchronously = compSync; // IsCompleted = isComp; }
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); } }
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); } }