protected override void DoConcreteWork() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown bool flag = false; flag = true; if (ShouldSendPackage()) { DataPackageEnvelope packageEnvelope = null; lock (_lockObject) { packageEnvelope = new DataPackageEnvelope(UserToken, (bool?)ShouldPerformSignInOnNextDoWork, (bool?)ShouldPerformSignOutOnNextDoWork, (DateTime?)DataPackageEnvelopeAwsReceiver.ServerTime, GetActiveCols().ToList(), new List <CollectorConfig>(), (long?)GetAndIncrementPackageSequence(), Environment.OSVersion.ToString(), GetVersion(), GetDeviceIdentification(), (Guid?)Guid.NewGuid(), (bool?)flag, GetDataPackages()); if (ShouldPerformSignInOnNextDoWork) { ShouldPerformSignInOnNextDoWork = false; } } try { Receiver.AddDataPackageEnvelope(packageEnvelope); } catch (Exception ex) { StaticFileLogger.Current.LogEvent(GetType().Name + ".DoConcreteWork()", "Error performing concrete work", ex.Message, EventLogEntryType.Error); } } }
public void AddDataPackageEnvelope(DataPackageEnvelope packageEnvelope) { lock (_lockObject) { _queue.Enqueue(packageEnvelope); } }
private bool TrySendingMessage(DataPackageEnvelope nextMessage) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown try { StaticFileLogger.Current.LogEvent(GetType().Name + ".TrySendingMessage()", $"Sending message #{nextMessage.Sequence} of type: " + nextMessage.Packages[0].ColType, "", EventLogEntryType.Information); ClientApi val = new ClientApi(Configuration); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.Request = Configuration.ApiClient.Serialize((object)nextMessage); DataPackageReceipt val2 = val.Push(nextMessage); if (val2.ServerTime.HasValue) { ServerTime = val2.ServerTime.Value; } OnResponseReceived(val2); communicationLog.Response = val2.ToJson(); if (_debugDumpTraffic) { StaticFileLogger.Current.LogEvent(GetType().Name + ".TrySendingMessage()", $" Data sent was: {communicationLog.ToString()}", "", EventLogEntryType.Information); } LatestLog = communicationLog; return(true); } catch (Exception ex) { StaticFileLogger.Current.LogEvent(GetType().Name + ".TrySendingMessage()", $" Error sending message to server. Message was : {ex.Message}. Exception is: {ex.ToString()}", "", EventLogEntryType.Error); return(false); } }
private void TrySendingAllQueuedMessages() { StaticFileLogger.Current.LogEvent(GetType().Name, "TrySendingAllQueuedMessages", $"Current envelopes in queue: {_queue.EnvelopesInQueue}", EventLogEntryType.Information); for (int i = 0; i < _queue.EnvelopesInQueue; i++) { lock (this) { DataPackageEnvelope nextMessage = _queue.PeekNextDataPackageEnvelope(); if (!TrySendingMessage(nextMessage)) { return; } DataPackageEnvelope val = _queue.DequeueNextDataPackageEnvelopeToSend(); _debugSentMessageIds.Add(val.Sequence.Value); } } }
public void AddDataPackageEnvelope(DataPackageEnvelope dataPackageEnvelope) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown StaticFileLogger.Current.LogEvent(GetType().Name + ".AddDataPackageEnvelope()", $"Adding message:{dataPackageEnvelope.ToJson()} to queue.", "", EventLogEntryType.Information); if (IsInternalCGITestMode) { if (!_hasSentDummyDemoResponse) { int num = 10; int num2 = 60; string text = $"The DPV client is now running in demo mode. It will start harvesting in {num} seconds, and end in {num2} seconds."; OnResponseReceived(new DataPackageReceipt((int?)1, text, (int?)num, (int?)num2, (DateTime?)null, (List <DataPackageReceipt.ActivateColsEnum>)null, (List <CollectorConfig>)null)); _hasSentDummyDemoResponse = true; } } else if (IsStudentDemoMode) { if (!_hasSentDummyDemoResponse) { OnResponseReceived(new DataPackageReceipt((int?)1, (string)null, (int?)null, (int?)null, (DateTime?)null, (List <DataPackageReceipt.ActivateColsEnum>)null, (List <CollectorConfig>)null)); _hasSentDummyDemoResponse = true; } } else { try { AddEnvelopeToQueue(dataPackageEnvelope); TrySendingAllQueuedMessages(); } catch (Exception ex) { StaticFileLogger.Current.LogEvent(GetType().Name + ".AddDataPackageEnvelope() exception", "Exception occurred", $"Error message: {ex.Message}", EventLogEntryType.Error); } } }
private void AddEnvelopeToQueue(DataPackageEnvelope dataPackageEnvelope) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) StaticFileLogger.Current.LogEvent(GetType().Name + ".AddEnvelopeToQueue()", $"Adding message #{dataPackageEnvelope.Sequence} of type: " + dataPackageEnvelope.Packages[0].ColType + " to queue", "", EventLogEntryType.Information); _queue.AddDataPackageEnvelope(dataPackageEnvelope); }