Python freeopcua server: how to know number of connected clients? #1469
-
I have successfully set-up a freeopcua server and it communicates well with clients but now I would like to know how many clients are connected to my server. Is there a method or workaround to know how many clients are connected to a freeopcua server? In fact, this is a question I found at https://stackoverflow.com/, I have the same requirement, I want to know how many connections the ua server currently has, and I want to know how to clean up invalid client connections, This will ensure that the currentSessionCount of ua will not be too large Here is its answer, This answer disappointed me
I would like to confirm that this answer. help me please. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
This should also work for python-opcua: FreeOpcUa/opcua-asyncio#845 |
Beta Was this translation helpful? Give feedback.
-
Very bad programming way, which breaks any OOP rule, but you can do this:
The class InteralSession keep the protected _current_connections counter that, at moment 1.0pre, is In my case, I have a server that exposes a node for server debugging and the number of connected sessions is important:
|
Beta Was this translation helpful? Give feedback.
This should also work for python-opcua: FreeOpcUa/opcua-asyncio#845