Ejemplo n.º 1
0
        /*
         * public Tashjik.Common.Data getData(String key)
         * {
         *      byte[] byteKey = System.Text.Encoding.ASCII.GetBytes(key);
         *      Node successor = thisNode.findSuccessor(byteKey, thisNode);
         *      return successor.getData(byteKey);
         * }
         *
         *
         *
         * public void putData(String key, Tashjik.Common.Data data)
         * {
         *      byte[] byteKey = System.Text.Encoding.ASCII.GetBytes(key);
         *      Node successor = thisNode.findSuccessor(byteKey, thisNode);
         *      successor.putData(byteKey, data);
         * }
         */

        //returns IP of successor....
        public void beginFindSuccessor(byte[] hashedKey, AsyncCallback findSuccessorCallBack, Object appState, Guid relayTicket)
        {
            Console.WriteLine("ChordServer::beginFindSuccessor ENTER");

            Stack <Object> thisAppState = new Stack <Object>();

            thisAppState.Push(findSuccessorCallBack);
            thisAppState.Push(appState);
            thisNode.beginFindSuccessor(hashedKey, thisNode, new AsyncCallback(processFindSuccessorForFindSuccessor), thisAppState, new Guid("00000000-0000-0000-0000-000000000000"));
        }
Ejemplo n.º 2
0
 public override Tashjik.Tier0.TransportLayerCommunicator.Data notifyTwoWayRelayMsg(IPAddress fromIP, IPAddress originalFromIP, byte[] buffer, int offset, int size, Guid relayTicket)
 {
     Console.WriteLine("ChordProxyNode::notifyTwoWayRelayMsg ENTER");
     String[] split = splitMsgBuffer(buffer, offset, size);
     if (String.Compare(split[0], "FIND_SUCCESSOR") == 0)
     {
         Console.WriteLine("ChordProxyNode::notifyTwoWayRelayMsg message = FIND_SUCCESSOR");
         IP_ChordProxyNode iIP_ChordProxyNode = new IP_ChordProxyNode(originalFromIP, this, relayTicket);
         thisNode.beginFindSuccessor(System.Text.Encoding.ASCII.GetBytes(split[1]), (IChordNode)(proxyController.getProxyNode(originalFromIP)), new AsyncCallback(processFindSuccessor_notifyTwoWayRelayMsg_callback), iIP_ChordProxyNode, relayTicket);
     }
     return(null);
 }