shrimpy-python
shrimpy-python copied to clipboard
Clearing the is_closed flag in _connect() creates a race condition
If the program attempts to call disconnect before _connect() is reached by the new thread created in connect(), is_closed is set before it is cleared and the program never exits.
Also, renamed is_closed to close_requested to make the purpose of the variable more clear.
Samples should be updated to include:
# Once complete, stop the client
#add this line \/
input("Press Enter to exit...")
#add this line /\
client.disconnect()
Otherwise, they will exit immediately without printing anything.