Open.NAT icon indicating copy to clipboard operation
Open.NAT copied to clipboard

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

Open jianmingyong opened this issue 6 years ago • 2 comments

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.

jianmingyong avatar Dec 23 '19 09:12 jianmingyong

Yes, you are right, thank you.

lontivero avatar Mar 27 '20 21:03 lontivero

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

lontivero avatar Jan 09 '22 04:01 lontivero