Esempio n. 1
0
        /// <summary>
        /// Creates a new manager that pumps a heartbeat at a specified interval.
        /// </summary>
        /// <param name="heartbeat">Heartbeat to pump.</param>
        /// <param name="interval">Interval to pump at.</param>
        /// <param name="server">Server that manages the Heartbeat information.</param>
        public HeartbeatManager(IHeartbeat heartbeat, TimeSpan interval, IHeartbeatServer server)
        {
            Heartbeat = heartbeat;
            Server    = server;

            UpdateTimer = new Timer(interval.TotalMilliseconds);
            UpdateTimer.Start();
            UpdateTimer.Elapsed += UpdateTimerHandler;

            IsRunning = true;

            Server.Log("Manager started!");
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new manager that pumps a heartbeat at a specified interval.
        /// </summary>
        /// <param name="heartbeat">Heartbeat to pump.</param>
        /// <param name="interval">Interval to pump at.</param>
        /// <param name="server">Server that manages the Heartbeat information.</param>
        public HeartbeatManager(IHeartbeat heartbeat, TimeSpan interval, IHeartbeatServer server)
        {
            Heartbeat = heartbeat;
            Server = server;

            UpdateTimer = new Timer(interval.TotalMilliseconds);
            UpdateTimer.Start();
            UpdateTimer.Elapsed += UpdateTimerHandler;

            IsRunning = true;

            Server.Log("Manager started!");
        }