static void Main(string[] args) { if (args.Length < 2) { Environment.Exit(0); } CDService cdService = new CDService(args[0], args[1]); System.Console.WriteLine("<enter> para sair..."); System.Console.ReadLine(); }
/// <summary> /// Sends the list of participants to all active participants in the system /// </summary> public void sendTopologyToAll(List <Dictionary <UInt64, string> > parts, CDService cDir) { System.Console.WriteLine("SEND TOPOLOGY"); foreach (string url in parts.ElementAt(0).Values) { IClient participantToSend = (IClient)Activator.GetObject(typeof(IClient), url); participantToSend.receiveNetworkMembership(parts); } foreach (string url in parts.ElementAt(1).Values) { IServer participantToSend = (IServer)Activator.GetObject(typeof(IServer), url); try { participantToSend.receiveNetworkMembership(parts); } catch (RemoteServerFailedException) { cDir.deregisterServer(url); } } }
/// <summary> /// Sends the list of participants to all active participants in the system /// </summary> public void sendTopologyToAll(List<Dictionary<UInt64, string>> parts, CDService cDir) { System.Console.WriteLine("SEND TOPOLOGY"); foreach (string url in parts.ElementAt(0).Values) { IClient participantToSend = (IClient)Activator.GetObject(typeof(IClient), url); participantToSend.receiveNetworkMembership(parts); } foreach (string url in parts.ElementAt(1).Values) { IServer participantToSend = (IServer)Activator.GetObject(typeof(IServer), url); try { participantToSend.receiveNetworkMembership(parts); } catch (RemoteServerFailedException) { cDir.deregisterServer(url); } } }