added socket listener thread code to server class