server with while loop