Skip to content

Commit

Permalink
fix(DotClient): better timeout code
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed May 24, 2018
1 parent 6f6a768 commit ecd3846
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ protected override void Dispose(bool disposing)

// Cancel the request when either the timeout is reached or the
// task is cancelled by the caller.
var cts = CancellationTokenSource.CreateLinkedTokenSource(cancel);
cts.CancelAfter(Timeout);
var cts = CancellationTokenSource.CreateLinkedTokenSource(
cancel,
new CancellationTokenSource(Timeout).Token);
var tcs = new TaskCompletionSource<Message>();
OutstandingRequests[request.Id] = tcs;

Expand Down

0 comments on commit ecd3846

Please sign in to comment.