Table of Contents

Class SessionUsage

Namespace
VpnHood.Core.Server.Access.Messaging
Assembly
VpnHood.Core.Server.Access.dll

Represents a session's traffic since its last report, or its close, as the server sends them to the access manager.

public class SessionUsage
Inheritance
SessionUsage
Inherited Members

Properties

AdData

Gets or sets a rewarded ad's data, or null.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? AdData { get; set; }

Property Value

string

Closed

Gets or sets a value indicating whether the session closed, for older readers.

[Obsolete("Use ErrorCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool Closed { get; set; }

Property Value

bool

ErrorCode

Gets or sets the error the session closed with, or Ok where it goes on.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public SessionErrorCode ErrorCode { get; set; }

Property Value

SessionErrorCode

Received

Gets or sets the session's received bytes since its last report.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long Received { get; set; }

Property Value

long

Sent

Gets or sets the session's sent bytes since its last report.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long Sent { get; set; }

Property Value

long

SessionId

Gets or sets the session's ID.

public required ulong SessionId { get; set; }

Property Value

ulong

Methods

ToTraffic()

Gets the usage's bytes as traffic.

public Traffic ToTraffic()

Returns

Traffic

The sent and received bytes.