server listening thread