Option to start the client and server as daemons #1201
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added a new setter to the client and server (.setDaemon), to be used before starting the client/server.
When set to true, all threads spawned by the server and client will be marked as daemon to allow for the exit of the application.
Related Issue
Fixes #888
Motivation and Context
I have an app that is using this library and whenever I closed the app I noticed it never exited, it kept running on the background despite closing the window. I found out the issue was caused by this library since threads spawned were not marked as daemon nor there was a way to specify it. I forked the library and fixed it and then I saw there was already an issue about it so I thought about contributing.
How Has This Been Tested?
I started a client and server and called .setDaemon(true) , then I closed the window of my app and it exited correctly instead of running itself on the background.
Types of changes
Checklist: