Re: Designing a server for Java applet
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---910079544-895597787-1211502288=:22641
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
On Thu, 22 May 2008, GT wrote:
On May 21, 6:37?pm, Tom Anderson <t...@urchin.earth.li> wrote:
On May 21, 10:46 am, GT <dtsw...@googlemail.com> wrote:
I've developed a Java applet based on an old board game, mainly as a
learning exercise. I've just yesterday finished my first effort at the
server for it, so now two applets can play the game against each other
over my network.
GT, the solution to your problem is a good old semaphore, aka mutex. You
set up an object to use as the semaphore, which could well be one of these
server context things. When your next-move-wanting thread comes in, it
goes:
That was excellent, thanks, I've reimplemented my server today with
semaphores. I think I'll stick with http communication. My next decision
then, is how to delete games I've added to the server, specfically, when
to delete them. I need an event - currently I timestamp games and clean
them up whenever a new game is added. Equally I could do this every time
a move is received, but I need an event to spark this off. Does anyone
think I should be checking for dead games on a timer instead? How's that
done?
With crontab -e and wget.
tom
--
:-( bad :-) bad :-| good
---910079544-895597787-1211502288=:22641--