public void SetLoggerHandler(MessageForLogger handler) { LogMessage += handler; m_protocol.SetLoggerHandler(handler); m_suzuki.SetLoggerHandler(handler); m_election.SetLoggerHandler(handler); }
public void Init(MessageForLogger handler) { m_configuration = JsonConvert.DeserializeObject <Config.Configuration>(ReadConfig(ConfigPath)); m_protocol.Init(m_configuration); m_suzuki.Init(m_configuration); m_suzuki.Send = Send; m_suzuki.SendBroadcast = SendBroadcast; m_suzuki.RestartElection = StartElection; m_election.Init(m_configuration); m_election.Send = Send; m_election.SendBroadcast = SendBroadcast; m_election.WonElection = ElectionEnded; m_receiver = new Thread(QueryMessage); m_receiver.Start(); SetLoggerHandler(handler); LogMessage(this, "Suzuki started. Node info: [" + m_configuration.NodeID + "] Port:" + m_configuration.Port); }
public void SetLoggerHandler(MessageForLogger handler) { LogMessage += handler; }