internal BackupServer(Server server, string primaryAddress, Dictionary <int, IPadInt> pdInts) : base(server, pdInts) { PrimaryAddress = primaryAddress; PrimaryServer = (IServer)Activator.GetObject(typeof(IServer), primaryAddress); PrimaryServer.CreatePrimaryServer(Server.Address, padIntDictionary, false); // Create a timer with inAliveInterval second interval. imAliveTimer = new PadIntTimer(IM_ALIVE_INTERVAL); imAliveTimer.Timer.Elapsed += new ElapsedEventHandler(ImAliveEvent); //starts im alive timer imAliveTimer.Start(); StateMsg = "BACKUP STATE"; }
internal PrimaryServer(Server server, String backupAddress, Dictionary <int, IPadInt> pdInts) : base(server, pdInts) { BackupAddress = backupAddress; BackupServer = (IServer)Activator.GetObject(typeof(IServer), backupAddress); // Create a timer with IM_ALIVE_INTERVAL second interval. imAliveTimer = new PadIntTimer(IM_ALIVE_INTERVAL); imAliveTimer.Timer.Elapsed += new ElapsedEventHandler(ImAliveEvent); // Create a timer with BACKUP_REPLY_INTERVAL second interval. backupReplyTimer = new PadIntTimer(BACKUP_REPLY_INTERVAL); backupReplyTimer.Timer.Elapsed += new ElapsedEventHandler(BackupReplyEvent); //starts im alive timer imAliveTimer.Start(); StateMsg = "PRIMARY STATE"; }