Working version with threads listeners, needed additional socket to shut down server and change main loop to non-forever