Reece
99c5e1fa65
[*] Split up Aurora Async [*] Split Async app into seperate ThreadPool concept [*] Fix various OSThread bugs and tls transfer issues [*] Set default affinity to 0xFFFFFFFF [*] Update Build script [+] Add AuTuplePopFront [+] New Network Interface (unimplemented) [*] Stub out the interfaces required for a better logger [*] Fix Win32 ShellExecute bug; windows 11 struggles without explicit com init per the docs - now deferring to thread pool [*] Update gitignore [*] Follow XDG home standard [*] Refactor some namespaces to use the shorthand aliases [*] Various stability fixes
36 lines
854 B
C++
36 lines
854 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: SocketStatChannel.hpp
|
|
Date: 2021-10-31
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#include "SocketStatAverageBps.hpp"
|
|
|
|
namespace Aurora::IO::Net
|
|
{
|
|
struct SocketStatChannel
|
|
{
|
|
SocketStatAverageBps bandwidth;
|
|
AuUInt64 total;
|
|
|
|
// Interpolated bytes per second, may be less than expected (returning frame -1)
|
|
inline AuUInt32 GetAverageBytesPerSecond()
|
|
{
|
|
return bandwidth.GetLastBytesPerSecond();
|
|
}
|
|
|
|
inline AuUInt32 GetBytesPerSecond()
|
|
{
|
|
return bandwidth.GetBytesPerSecondNormalized(Time::CurrentClockMS());
|
|
}
|
|
|
|
inline void Add(AuUInt32 bytes)
|
|
{
|
|
total += bytes;
|
|
bandwidth.Add(Time::CurrentClockMS(), bytes);
|
|
}
|
|
};
|
|
} |