basic server thread