public void SendExistingServersList(List <Tuple <string, RemotingAddress> > serverList) { foreach (Tuple <string, RemotingAddress> serv in serverList) { if (Server.serverID != serv.Item1) { IServerS servChannel = (IServerS)Activator.GetObject(typeof(IServerS), serv.Item2.ToString()); Server.otherServers.Add(new OtherServer(servChannel, serv.Item1, serv.Item2)); ConcurrentBag <MeetingProposal> rMeets = servChannel.GetMeetingPropList(); foreach (MeetingProposal m in rMeets) { Server.meetingPropList.Add(m); } ConcurrentBag <Tuple <string, RemotingAddress> > sC = servChannel.GetClientsList(); foreach (Tuple <string, RemotingAddress> s in sC) { IClient cliChannel = (IClient)Activator.GetObject(typeof(IClient), s.Item2.ToString()); Client nClient = new Client(cliChannel, s.Item1, s.Item2); Server.clients.Add(nClient); cliChannel.RegisterServerReplica(Server.serverID, Server.serverRAForClients); } } } }
public void BroadcastNewServer(Tuple <string, RemotingAddress> newServer) { if (Server.serverID != newServer.Item1) { IServerS newServerChannel = (IServerS)Activator.GetObject(typeof(IServerS), newServer.Item2.ToString()); Server.otherServers.Add(new OtherServer(newServerChannel, newServer.Item1, newServer.Item2)); } }
public OtherServer(IServerS serverChannel, string serverID, RemotingAddress serverRA) { this.ServerChannel = serverChannel; this.ServerID = serverID; this.ServerRA = serverRA; }