_logger.LogWarning("Node server will send updates to {0}.", endpoint);
_server = endpoint;
- _client = new UdpClient
+ _client = new UdpClient();
+
+ try
+ {
+ _client.DontFragment = true;
+ }
+ catch (SocketException)
{
- DontFragment = true
- };
+ }
}
}
public bool Expired => LastUpdated < DateTimeOffset.UtcNow.AddHours(-1);
}
}
-}
\ No newline at end of file
+}
throw new ArgumentException("UdpMasterEndpoint should be in the ip:port format.");
}
- _client = new UdpClient(endpoint)
+ _client = new UdpClient(endpoint);
+
+ try
{
- DontFragment = true,
- };
+ _client.DontFragment = true;
+ }
+ catch (SocketException)
+ {
+ }
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
_logger.LogWarning("Master server node update listener is stopping.");
}
}
-}
\ No newline at end of file
+}