moved socketthread monitoring and starting into the single thread