Skip to content

Commit c2dbee1

Browse files
authored
Use new TimeSpan.TotalMicroseconds API in Socket.ToTimeoutMicroseconds (#68030)
1 parent b13513a commit c2dbee1

File tree

1 file changed

+1
-1
lines changed
  • src/libraries/System.Net.Sockets/src/System/Net/Sockets

1 file changed

+1
-1
lines changed

src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ public static void Select(IList? checkRead, IList? checkWrite, IList? checkError
21782178

21792179
private static int ToTimeoutMicroseconds(TimeSpan timeout)
21802180
{
2181-
long totalMicroseconds = timeout.Ticks / 10;
2181+
long totalMicroseconds = (long)timeout.TotalMicroseconds;
21822182
if (totalMicroseconds < -1 || totalMicroseconds > int.MaxValue)
21832183
{
21842184
throw new ArgumentOutOfRangeException(nameof(timeout));

0 commit comments

Comments
 (0)