Skip to content

Commit 26e48e0

Browse files
committed
Updated logging.
1 parent 9aa5492 commit 26e48e0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Examples/MAUI-gRPC/AntGrpcService/Services/DiscoveryService.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ public class DiscoveryService(ILogger<DiscoveryService> logger) : BackgroundServ
1212

1313
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
1414
{
15-
_logger.LogInformation("DiscoveryService running. Multicast group {GroupAddress}", grpAddress.ToString());
16-
1715
// create IPv4 UDP client
1816
IPAddress? localIPAddress = Dns.GetHostAddresses(Dns.GetHostName()).Where(a => a.AddressFamily == AddressFamily.InterNetwork).FirstOrDefault();
1917
if (localIPAddress == null)
@@ -28,6 +26,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
2826
{
2927
// join multicast group
3028
udpClient.JoinMulticastGroup(grpAddress);
29+
_logger.LogInformation("DiscoveryService running. Listening on {LocalIp}.", udpClient.Client.LocalEndPoint!.ToString());
3130

3231
// Loop listening for service requests. UDP is not reliable and multiple clients may request access to service.
3332
while (!stoppingToken.IsCancellationRequested)

0 commit comments

Comments
 (0)