简体   繁体   中英

Python freeopcua server: how to know number of connected clients?

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?

For OPC UA it should be in Server/ServerDiagnostics/ServerDiagnosticsSummary/CurrentSessionCount

But afaik there is absolutely no code included about all this Diagnostics-Stuff neither in python-opcua nor in opcua-asyncio .

A workaround would be to implement it and pull request.. haha

You can check for established connections, something like netstat -anp | grep:4840 | grep ESTABLISHED | wc -l netstat -anp | grep:4840 | grep ESTABLISHED | wc -l netstat -anp | grep:4840 | grep ESTABLISHED | wc -l . In Py3 you could do something similar with psutil.net_connections() and also filter for Port and ESTABLISHED . Docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM