your main loop already on accept when your thread change the go_on imho try to input another string after 'quit' and actually there is no need to use thread