February 22nd, 2000, 06:48 AM
Hi,
I'm creating a game servlet. The game is supposed to be played only within specific time-limits. Can I have a timer thread inside the servlet which continously keeps track of the time and as soon as the time limit is reached informs the player about the same?
The problem that i have here is not so much of a time-out issue where i have to check the "last accessed time". the user is very much active ... he is playing the game and i want to stop him in between at a particular scheduled time. so i want a thread to keep running.. which compares the current time with the scheduled time and as soon as scheduled time arrives, i want to give the user a message that the game play time is over.
If I could get some sample code of threads being spawned from servlets ... that'll be great. Any suggestions on how I could implement this are awaited eagerly.
Thanx in advance.
I'm creating a game servlet. The game is supposed to be played only within specific time-limits. Can I have a timer thread inside the servlet which continously keeps track of the time and as soon as the time limit is reached informs the player about the same?
The problem that i have here is not so much of a time-out issue where i have to check the "last accessed time". the user is very much active ... he is playing the game and i want to stop him in between at a particular scheduled time. so i want a thread to keep running.. which compares the current time with the scheduled time and as soon as scheduled time arrives, i want to give the user a message that the game play time is over.
If I could get some sample code of threads being spawned from servlets ... that'll be great. Any suggestions on how I could implement this are awaited eagerly.
Thanx in advance.