Passed
Push — master ( ac4373...69549d )
by Olivier
04:26 queued 01:55
created

client_to_prosys_crypto.main()   A

Complexity

Conditions 3

Size

Total Lines 10
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 10
nop 0
dl 0
loc 10
rs 9.9
c 0
b 0
f 0
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