C# Class Microsoft.HockeyApp.Channel.Sender

Fetch transmissions from the storage and sends it.
Inheritance: IDisposable
Afficher le fichier Open project: bitstadium/HockeySDK-Windows

Protected Properties

Свойство Type Description
DelayHandler System.Threading.AutoResetEvent

Private Properties

Свойство Type Description
CalculateNextInterval System.TimeSpan
GetStatusCode int?
IsRetryable bool
LogInterval void
Sender System
StopAsync Task

Méthodes publiques

Méthode Description
Dispose ( ) : void

Disposes the managed objects.

Méthodes protégées

Méthode Description
Send ( StorageTransmission transmission, System.TimeSpan &nextSendInterval ) : bool

Sends a transmission and handle errors.

SendLoop ( ) : void

Send transmissions in a loop.

Private Methods

Méthode Description
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.

Method Details

Dispose() public méthode

Disposes the managed objects.
public Dispose ( ) : void
Résultat void

Send() protected méthode

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.
Résultat bool

SendLoop() protected méthode

Send transmissions in a loop.
protected SendLoop ( ) : void
Résultat void

Property Details

DelayHandler protected_oe property

A wait handle that flags the sender when to start sending again. The type is protected for unit test.
protected AutoResetEvent,System.Threading DelayHandler
Résultat System.Threading.AutoResetEvent