griffin.networking
griffin.networking copied to clipboard
DigestAuthenticator should implement IDisposable
The DigestAuthenticator class in the HTTP project should implement IDisposable in order to dispose the NonceService (the inside Timer). As long the Timer is running a strong reference will keep the instance alive. In this way, new DigestAuthenticator instances will leak memory. I'd also consider to expose the IDisposable interface to the HttpService, for the dispose chain. Because the not-so-comfortable disposal of instances, another solution might be to have a centralized clock source (i.e. singleton), then turn any NonceService as a weak-observer of this source.
The example as in may lead to memory leaks: https://github.com/jgauffin/griffin.networking/blob/master/Source/Protocols/Http/Griffin.Networking.Protocol.Http.DemoServer/Basic/MyHttpService.cs