Describe the bug
When initializing an OPC UA server, I observed that the variable _current_connections in internal_session.py accurately tracks the number of clients connected to the server, essentially reflecting the number of open sessions. However, there seems to be a discrepancy with another variable, CurrentSessionCount, located within the ServerDiagnosticsSummaryDataType class. Unlike _current_connections, CurrentSessionCount consistently remains at 0, failing to update as client sessions change.
Question: Is it expected behavior for CurrentSessionCount to not mirror the actual number of active sessions, or is this an inconsistency that needs addressing? I would like CurrentSessionCount to reflect the same value as _current_connections.
Attempted Workaround:
To align the values of these variables, I attempted the following workaround:
## Assuming server has been initialized and configured
async with server:
try:
while True:
if ServerDiagnosticsSummaryDataType.CurrentSessionCount != server.iserver.isession._current_connections:
ServerDiagnosticsSummaryDataType.CurrentSessionCount = server.iserver.isession._current_connections
await asyncio.sleep(1)
To Reproduce
Check the value of CurrentSessionCount using a print statement:
from asyncua.ua.uaprotocol_auto import ServerDiagnosticsSummaryDataType
print(ServerDiagnosticsSummaryDataType.CurrentSessionCount)
Connect multiple clients to the server.
Observe that the value of CurrentSessionCount remains unchanged despite the varying number of connections.
Expected behavior
I expect the CurrentSessionCount variable to accurately reflect the real-time number of current sessions, rather than remaining static at 0.
Version
Python-Version: 3.11
opcua-asyncio Version: 1.0.6
Describe the bug
When initializing an OPC UA server, I observed that the variable _current_connections in internal_session.py accurately tracks the number of clients connected to the server, essentially reflecting the number of open sessions. However, there seems to be a discrepancy with another variable, CurrentSessionCount, located within the ServerDiagnosticsSummaryDataType class. Unlike _current_connections, CurrentSessionCount consistently remains at 0, failing to update as client sessions change. Question: Is it expected behavior for CurrentSessionCount to not mirror the actual number of active sessions, or is this an inconsistency that needs addressing? I would like CurrentSessionCount to reflect the same value as _current_connections. Attempted Workaround: To align the values of these variables, I attempted the following workaround:
To Reproduce
Expected behavior
I expect the CurrentSessionCount variable to accurately reflect the real-time number of current sessions, rather than remaining static at 0.
Version
Python-Version: 3.11 opcua-asyncio Version: 1.0.6