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

Incorrect termination of connectionHandlingThread #140

Open
igor-sladkov opened this issue May 5, 2023 · 0 comments
Open

Incorrect termination of connectionHandlingThread #140

igor-sladkov opened this issue May 5, 2023 · 0 comments

Comments

@igor-sladkov
Copy link

In verson 2.3.2
CS104_Slave_stop doesn't wait for whether connectionHandlingThread has terminated, when it's closing open connections and destroying threads. MasterConnection_close just clears isRunning flag then returns immediately.
After that connectionHandlingThread will not complete properly, connectionEventHandler will never be called and a socket will be in a waiting state.
It would be better to implement execution control of connectionHandlingThread, as is done for serverThread.
The stopRunning flag should be used as a request to terminate connectionHandlingThread in all cases instead of isRunning, including inside handleTimeouts (but better to replace it with "timeoutsOk = false;"). Waiting for thread termination (isRunning==false) might be added to MasterConnection_close.

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

No branches or pull requests

1 participant