Completed
Pull Request — master (#321)
by
unknown
02:53
created

client_to_prosys_crypto   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A main() 0 10 3
1
import sys
2
sys.path.insert(0, "..")
3
import logging
4
import asyncio
5
6
from asyncua import Client
7
8
9
async def main():
10
    client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
11
    client.set_security_string("Basic256Sha256,Sign,certificate-example.der,private-key-example.pem")
12
    client.session_timeout = 2000
13
    async with client:
14
        root = client.nodes.root
15
        objects = client.nodes.objects
16
        while True:
17
            print("childs og objects are: ", await objects.get_children())
18
            await asyncio.sleep(1)
19
20
21
22
if __name__ == "__main__":
23
    logging.basicConfig(level=logging.WARN)
24
    asyncio.run(main())
25