Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate endpoint when restarting server #1511

Open
VasilyBroze opened this issue Mar 14, 2023 · 0 comments
Open

Duplicate endpoint when restarting server #1511

VasilyBroze opened this issue Mar 14, 2023 · 0 comments

Comments

@VasilyBroze
Copy link

VasilyBroze commented Mar 14, 2023

Hello, I try to start-stop-start server, and then I see two endpoints.
image
What I am doing wrong ?
Thank you.

server = Server()
    server.set_endpoint("opc.tcp://0.0.0.0:4840/freeopcua/server/")
    uri = "http://examples.freeopcua.github.io"
    idx = server.register_namespace(uri)
    objects = server.get_objects_node()
    myobj = objects.add_object(idx, "MyObject")
    myvar = myobj.add_variable(idx, "MyVariable", 6.7)
    myvar.set_writable()  # Set MyVariable to be writable by clients
    server.start()
    try:
        count = 7.5
        while True:
            time.sleep(1)
            count += 0.1
            myvar.set_value(count)
            print(count)
            if round(count, 1) == 8:
                server.stop()
                print("stop")

            if round(count, 1) == 9:
                server.start()
                print("start")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant