public virtual async Task SendAsync()
{
if (Interlocked.CompareExchange(ref this.isSending, 1, 0) != 0)
{
throw new InvalidOperationException("SendAsync is already in progress.");
}
try
{
var httpService = ServiceLocator.GetService<IHttpService>();
await httpService.PostAsync(this.EndpointAddress, Content, ContentType, ContentEncoding, this.Timeout);
}
finally
{
Interlocked.Exchange(ref this.isSending, 0);
}
}
}