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

Multi-Threaded api.connect() not working in Ubuntu Linux #192

Open
cbeytas opened this issue Aug 18, 2021 · 0 comments
Open

Multi-Threaded api.connect() not working in Ubuntu Linux #192

cbeytas opened this issue Aug 18, 2021 · 0 comments

Comments

@cbeytas
Copy link

cbeytas commented Aug 18, 2021

vncdotool v1.0.0, python 3.8.10, twisted 20.3.0 and 21.2.0

A simple VNC connection attempt works fine under Windows but when run on Linux (Ubuntu 20.04) it fails to establish a TCP connection. The connection starts, but never progresses. Seems to be a Twisted reactor issue.

In ThreadedVNCClientProxy api.py line 77 it uses reactor.callWhenRunning. This is not thread-safe. The reactor has already been started so it has the same effect of just calling factory_connect directly from the main thread.

Wrapping it in reactor.callFromThread fixed the issue for me:
reactor.callFromThread(reactor.callWhenRunning, factory_connect, self.factory, host, port, family)

import vncdotool.api
vnc = vncdotool.api.connect(server)
print(vnc.protocol)
None
@pmhahn pmhahn changed the title Connection problems in Ubuntu Linux Multi-Threaded api.connect() not working in Ubuntu Linux Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants