Table of Contents

Class SessionManager

Namespace
VpnHood.Core.Server
Assembly
VpnHood.Core.Server.dll

Represents a server's sessions: it makes them for the clients, keeps their usage, and syncs it with the access manager.

public class SessionManager : IAsyncDisposable, IDisposable
Inheritance
SessionManager
Implements
Inherited Members

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Remarks

The quick close: the sessions close at once, and a last sync under way is asked to stop.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

Remarks

The graceful close: the sessions stop but stay open with the access manager, so they recover after a restart; it tries a last sync of their usage, which is asked to stop after 7 seconds, logging a failure and going on; then the rest is released as Dispose() does. A call waits for an earlier graceful close, and after a quick close it cleans up nothing more.

Report()

Logs the sessions' counts: the active, idle and dead ones and all of them, with their TCP channels and UDP connections.

public void Report()