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

Close VNC connection on drop #8

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Close VNC connection on drop #8

merged 1 commit into from
Oct 10, 2023

Conversation

wbenny
Copy link

@wbenny wbenny commented Oct 9, 2023

Hi!

If the VNC server closes the connection (e.g. VM or physical machine gets shut down), and the user doesn't call VncClient::close() manually, the async_connection_process_loop() get stuck in an infinite loop - because stop_ch is never triggered.

I would argue that it shouldn't be a user's responsibility to call a close() call - in similar vein that it's not a user's responsibility to call close on File or TcpStream.

This PR adds call to the VncInner::close() on Drop of VncInner to prevent a leak of a task that uses 100% of the CPU core.

@HsuJv HsuJv merged commit 5002d1a into HsuJv:main Oct 10, 2023
6 checks passed
@HsuJv
Copy link
Owner

HsuJv commented Oct 10, 2023

Thanks for the patch. I didn't think this through very well.

@HsuJv
Copy link
Owner

HsuJv commented Oct 10, 2023

'''
I would argue that it shouldn't be a user's responsibility to call a close() call - in similar vein that it's not a user's responsibility to call close on File or TcpStream.
'''

I agree with that and am currently working on this. Will have a new release when done.

@HsuJv
Copy link
Owner

HsuJv commented Oct 10, 2023

This commit shall now fix the close issue
8c50710

BRs.

@wbenny
Copy link
Author

wbenny commented Oct 10, 2023

You're the best! Thanks!

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

Successfully merging this pull request may close these issues.

2 participants