Skip to content

Commit

Permalink
Use new TimeSpan.TotalMicroseconds API in `Socket.ToTimeoutMicrosec…
Browse files Browse the repository at this point in the history
…onds` (dotnet#68030)
  • Loading branch information
deeprobin authored Apr 14, 2022
1 parent b13513a commit c2dbee1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ public static void Select(IList? checkRead, IList? checkWrite, IList? checkError

private static int ToTimeoutMicroseconds(TimeSpan timeout)
{
long totalMicroseconds = timeout.Ticks / 10;
long totalMicroseconds = (long)timeout.TotalMicroseconds;
if (totalMicroseconds < -1 || totalMicroseconds > int.MaxValue)
{
throw new ArgumentOutOfRangeException(nameof(timeout));
Expand Down

0 comments on commit c2dbee1

Please sign in to comment.