internal bool MarkAsSent() { return Interlocked.Exchange(ref _sendStatus, MessageAlreadySent) == MessageNotYetSent; }
private static void CheckRequestMessage(HttpRequestMessage request) { if (!request.MarkAsSent()) { throw new InvalidOperationException("The request message was already sent. Cannot send the same request message multiple times."); } }