/// <summary> /// Handles authentification information. /// </summary> /// <param name="aMessage"></param> private void HandleAuthResponse(Message aMessage) { try { _authTimer.Stop(); Handshake handshk = Handshake.Parser.ParseFrom(aMessage.Payload); AuthentifyWith(handshk); // Update with the real IP address IPEndPoint remoteEndPoint = (IPEndPoint)_client.Client.RemoteEndPoint; handshk.NodeInfo.IpAddress = remoteEndPoint.Address.ToString(); KnownHeight = handshk.Height; _pingPongTimer.Start(); } catch (Exception e) { _logger?.Error(e, "Error processing authentification information."); Dispose(); } AuthFinished?.Invoke(this, new AuthFinishedArgs()); }
private void AuthTimerElapsed(object sender, ElapsedEventArgs e) { _authTimer.Stop(); // dispose if (IsAuthentified) { return; } _logger?.Warn("Authentification timed out."); Dispose(); AuthFinished?.Invoke(this, new AuthFinishedArgs(RejectReason.AuthTimeout)); }
private void FireInvalidAuth(RejectReason reason) { AuthFinished?.Invoke(this, new AuthFinishedArgs(reason)); }