BrandonPotter / SimpleTCP

Straightforward .NET library to handle the repetitive tasks of spinning up and working with TCP sockets (client and server).
Apache License 2.0
365 stars 108 forks source link

Followup for recent RankIPAddresses update - extract method TryGetCurrentNetworkInterfaces #25

Closed brudo closed 6 years ago

brudo commented 6 years ago

This adds a try/catch handler around a previously unprotected call to GetAlllNetworkInterfaces, and simply does not boost the ranking if an error occurs when checking whether the NIC is the default router. (The extracted method could also be enhanced further to cache the result for a few seconds, to avoid repeated calls, but it doesn't do that right now.)

brudo commented 6 years ago

@BrandonPotter this is the change I committed on my branch last night. Anything further you would like to see? What do you think of the caching idea I mentioned above? Or shall I just merge?

brudo commented 6 years ago

I will just merge this now, since I should have included it in the original PR anyway. If there are other changes needed in this area we could always do another pull request.