Skip to content

Commit 3168a78

Browse files
hemanandrclaude
andcommitted
fix: resolve ProbeService compilation errors
- Fix SendPingAsync parameter types by using TimeSpan.FromMilliseconds - Fix ConnectAsync ValueTask to Task conversion with .AsTask() 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f5e9a2e commit 3168a78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ThingConnect.Pulse.Server/Services/Monitoring/ProbeService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public async Task<CheckResult> PingAsync(Guid endpointId, string host, int timeo
6161
try
6262
{
6363
// Use overload that accepts cancellation token
64-
PingReply reply = await ping.SendPingAsync(host, timeoutMs, null, null, combinedCts.Token);
64+
PingReply reply = await ping.SendPingAsync(host, TimeSpan.FromMilliseconds(timeoutMs), cancellationToken: combinedCts.Token);
6565
stopwatch.Stop();
6666

6767
if (reply.Status == IPStatus.Success)
@@ -106,7 +106,7 @@ public async Task<CheckResult> TcpConnectAsync(Guid endpointId, string host, int
106106
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
107107

108108
// Use the combined cancellation token for the connection
109-
Task connectTask = tcpClient.ConnectAsync(host, port, combinedCts.Token);
109+
Task connectTask = tcpClient.ConnectAsync(host, port, combinedCts.Token).AsTask();
110110

111111
try
112112
{

0 commit comments

Comments
 (0)