Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Finalizer will not run in .Net Core builds, becareful and remember to manually call them. #94

Open
jianmingyong opened this issue Dec 23, 2019 · 2 comments

Comments

@jianmingyong
Copy link

Ever since .Net Core changed the behavior of finalizer, it will never release the ports on time. To be safe, users have to call NatDiscoverer.ReleaseSessionMappings(); manually to ensure it is properly released.

Sadly this break the last failover ditch effort some people may expect it to work. Of course there is still a workaround with this using:
AppDomain.CurrentDomain.ProcessExit event. Only use this workaround on .Net Core builds if you want to ensure it release the session mappings if people click the X button.

@lontivero
Copy link
Owner

Yes, you are right, thank you.

@lontivero
Copy link
Owner

This is important now because I will upgrade the library to netstandard2.0 soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants