Exemplo n.º 1
0
        private void HandleKeyRequest(KeyRequestMessage msg)
        {
            _processor.Stop();
            int c = _processor.KeyCount;

            var dataRspMsg = new KeyResponseMessage()
            {
                SourceID      = _config.ID,
                DestinationID = msg.SourceID,
                Address       = _config.TCPServerAddress,
                Port          = _config.TCPServerPort,
                KeyCount      = c
            };

            SendMessage(dataRspMsg, _group);
        }
Exemplo n.º 2
0
        private void _elector_OnElection(object sender, EventArgs e)
        {
            _responses.Clear();
            if (!_responseTimeout.Enabled)
            {
                _responseTimeout.Start();
            }

            var dataReqMsg = new KeyRequestMessage()
            {
                SourceID      = _config.ID,
                DestinationID = Constants.NULL_DESTINATION
            };

            SendMessage(dataReqMsg, _group);
        }