diff --git a/asyncua/sync.py b/asyncua/sync.py index 63993f594..9f334839c 100644 --- a/asyncua/sync.py +++ b/asyncua/sync.py @@ -249,9 +249,12 @@ def application_uri(self): def application_uri(self, value): self.aio_obj.application_uri = value - @syncmethod def connect(self) -> None: - pass + if not self.tloop.is_alive(): + self.tloop = ThreadLoop() + self.tloop.start() + self.close_tloop = True + self.tloop.post(self.aio_obj.connect()) def disconnect(self) -> None: try: @@ -592,9 +595,12 @@ def register_namespace(self, url): def get_namespace_array(self): pass - @syncmethod def start(self): - pass + if not self.tloop.is_alive(): + self.tloop = ThreadLoop() + self.tloop.start() + self.close_tloop = True + self.tloop.post(self.aio_obj.start()) def stop(self): self.tloop.post(self.aio_obj.stop())