Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'System.PlatformNotSupportedException' #702

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

ColdeZhang
Copy link
Contributor

Under some special OS env (such as docker container), may throw exception below:

Unhandled exception. System.PlatformNotSupportedException: The system's ping utility could not be found.
   at System.Net.NetworkInformation.Ping.GetPingProcess(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
   at System.Net.NetworkInformation.Ping.SendWithPingUtilityAsync(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
   at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken)
   at Lagrange.Core.Utility.Network.Icmp.PingAsync(Uri hostIp, Int32 timeout)
   at Lagrange.Core.Internal.Context.SocketContext.OptimumServer(Boolean requestMsf, Boolean useIPv6Network)
   at Lagrange.Core.Internal.Context.SocketContext.Connect()

This PR adding try catch to ensuring that application can continue running without crashing.

Copy link
Collaborator

@Executor-Cheng Executor-Cheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢贡献, 但你需要将代码签名再提交

@ColdeZhang
Copy link
Contributor Author

感谢贡献, 但你需要将代码签名再提交

好的 已经重新签名并提交

@Executor-Cheng Executor-Cheng merged commit d9630a7 into LagrangeDev:master Dec 4, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants