예제 #1
0
        private void receiveBootStrapNode(IPAddress fromIP, byte[] buffer, int offset, int size)
        {
            Console.WriteLine("Client::receiveBootStrapNode ENTER");
            //Console.WriteLine(Encoding.ASCII.GetString(buffer));
            //ChordServer chord;
            Zhimera.ZhimeraServer zhimera;

            if (String.Compare(Encoding.ASCII.GetString(buffer), "no bootstrapnode") == 0)
            {
                Console.WriteLine("Client::receiveBootStrapNode NO bootstrapnode received");

                zhimera = new Zhimera.ZhimeraServer();
            }
            else
            {
                Console.WriteLine("Client::receiveBootStrapNode bootstrapnode RECEIVED");
                Console.Write("RECEIVED bootstrapnode=");
                String strBootStrapData = Encoding.ASCII.GetString(buffer);
                Console.WriteLine(strBootStrapData);
                String[] split          = strBootStrapData.Split(new char[] { '\t' });
                String   strBootStrapIP = split[0];
                String   strBootStrapChordInstanceGuid = split[1];
                Console.WriteLine(strBootStrapIP);
                Console.WriteLine(strBootStrapChordInstanceGuid);
                IPAddress bootStrapIP = UtilityMethod.convertStrToIP(strBootStrapIP);

                zhimera = new Zhimera.ZhimeraServer(bootStrapIP, new Guid(strBootStrapChordInstanceGuid));
            }
        }
예제 #2
0
		private void receiveBootStrapNode(IPAddress fromIP, byte[] buffer, int offset, int size)
		{
			Console.WriteLine("Client::receiveBootStrapNode ENTER");
			//Console.WriteLine(Encoding.ASCII.GetString(buffer));
			//ChordServer chord;
            Zhimera.ZhimeraServer zhimera;

			if(String.Compare(Encoding.ASCII.GetString(buffer), "no bootstrapnode") == 0)
			{
				Console.WriteLine("Client::receiveBootStrapNode NO bootstrapnode received");

                zhimera = new Zhimera.ZhimeraServer();

			}
			else
			{
				Console.WriteLine("Client::receiveBootStrapNode bootstrapnode RECEIVED");
				Console.Write("RECEIVED bootstrapnode=");
				String strBootStrapData = Encoding.ASCII.GetString(buffer);
				Console.WriteLine(strBootStrapData);
				String[] split = strBootStrapData.Split(new char[] {'\t'});
				String strBootStrapIP = split[0];
				String strBootStrapChordInstanceGuid = split[1];
				Console.WriteLine(strBootStrapIP);
				Console.WriteLine(strBootStrapChordInstanceGuid);
                IPAddress bootStrapIP = UtilityMethod.convertStrToIP(strBootStrapIP);

                zhimera = new Zhimera.ZhimeraServer(bootStrapIP, new Guid(strBootStrapChordInstanceGuid));

								
			}
		}