C# Класс Microsoft.HockeyApp.Channel.Sender

Fetch transmissions from the storage and sends it.
Наследование: IDisposable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
DelayHandler System.Threading.AutoResetEvent

Private Properties

Свойство Тип Описание
CalculateNextInterval System.TimeSpan
GetStatusCode int?
IsRetryable bool
LogInterval void
Sender System
StopAsync Task

Открытые методы

Метод Описание
Dispose ( ) : void

Disposes the managed objects.

Защищенные методы

Метод Описание
Send ( StorageTransmission transmission, System.TimeSpan &nextSendInterval ) : bool

Sends a transmission and handle errors.

SendLoop ( ) : void

Send transmissions in a loop.

Приватные методы

Метод Описание
CalculateNextInterval ( int httpStatusCode, System.TimeSpan currentSendInterval, System.TimeSpan maxInterval ) : System.TimeSpan

Calculates the next interval using exponential back-off algorithm (with the exceptions of few error codes that reset the interval to SendingInterval.

GetStatusCode ( WebException e ) : int?

Return the status code from the web exception or null if no such code exists.

IsRetryable ( int httpStatusCode, WebExceptionStatus webExceptionStatus ) : bool

Returns true if httpStatusCode or webExceptionStatus are retriable.

LogInterval ( System.TimeSpan prevSendInterval, System.TimeSpan nextSendInterval ) : void

Log next interval. Only log the interval when it changes by more then a minute. So if interval grow by 1 minute or decreased by 1 minute it will be logged. Logging every interval will just make the log noisy.

Sender ( BaseStorageService storage, PersistenceTransmitter transmitter, bool startSending = true ) : System

Initializes a new instance of the Sender class.

StopAsync ( ) : Task

Stops the sender.

Описание методов

Dispose() публичный Метод

Disposes the managed objects.
public Dispose ( ) : void
Результат void

Send() защищенный Метод

Sends a transmission and handle errors.
protected Send ( StorageTransmission transmission, System.TimeSpan &nextSendInterval ) : bool
transmission StorageTransmission The transmission to send.
nextSendInterval System.TimeSpan When this value returns it will hold a recommendation for when to start the next sending iteration.
Результат bool

SendLoop() защищенный Метод

Send transmissions in a loop.
protected SendLoop ( ) : void
Результат void

Описание свойств

DelayHandler защищенное свойство

A wait handle that flags the sender when to start sending again. The type is protected for unit test.
protected AutoResetEvent,System.Threading DelayHandler
Результат System.Threading.AutoResetEvent