nauful / LibUA

Open-source OPC UA client and server library
Apache License 2.0
262 stars 94 forks source link

Set `IsBackground` to true for connection thread #156

Closed vbreuss closed 7 months ago

vbreuss commented 7 months ago

When using LibUA in a UI application and the application is exited without first disconnecting the client, the thread created in Client.Connect() hangs.

This pull request sets the IsBackground property of the connection thread to true, so that the application can be closed, because the thread is then tied to the application thread.

nauful commented 7 months ago

This is not necessary. The client should be run in a seperate thread from the Application's primary thread due to exceptions and unhandled exceptions. You should end that thread when the UI exits.