craig kenny wrote:
Hello all, appreciate any advice on how I may get the total inbound
outbound byte counts for a connected client session.
Indy does not keep track of that information, unless you manually call
the TIdTCPComponent.BeginWork() method, in which case you will then get
OnWork events containing the total byte count since BeginWork() was
called.
Otherwise, you will have to track the counts manually. For instance,
you could assign a TIdConnectionIntercept to the connection's Intercept
property, and then use the Intercept's OnReceive and OnSend events to
count the bytes in both directions.
On Windows Vista and later, you can alternatively use WinSock's own
GetPerTcpConnectionEStats() and GetPerTcp6ConnectionEStats() functions
to collection statistical data for a given TCP connection:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb485738.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb485735.aspx
Or you can use the ETW API to monitor EVENT_TRACE_FLAG_NETWORK_TCPIP
network events from KERNEL_LOGGER_NAME.
See:
how to count bytes sent and received per TCP connection (system-wide)?
https://stackoverflow.com/questions/4705292/
--
Remy Lebeau (TeamB)
Connect with Us