Sometimes, communication with the server fails. When this happens, a NullReferenceException in DiffieHellmanManaged.Dispose on the finalizer thread brings down the process.
The NullReferenceException in itself is not a problem. However, that it happens on the finalizer thread is. It looks like adding a using in Sharpen.DHKeyPairGenerator should solve this issue.
Sometimes, communication with the server fails. When this happens, a NullReferenceException in DiffieHellmanManaged.Dispose on the finalizer thread brings down the process.
The NullReferenceException in itself is not a problem. However, that it happens on the finalizer thread is. It looks like adding a using in Sharpen.DHKeyPairGenerator should solve this issue.