Assume you have made an internet game of tic-tac-toe or sth that is played between players. So, when a player inputs 'x' or 'o' or whatever is the input, the opponent must receive it on his pc.
I know how to make this with timer. But I'm interested in making it with an event. I mean, when the input is given we catch an event. Then, this event is reloading the opponent's page and he receives the info.
Is there any way I can achieve it? And does it worth it?
Thanks in advance for any responses!
There is something called HTTP Server Push. Usually, from what I read it is not recommended to use this since it seems to put a lot of load on the server which has to keep many connections open (for each browser that is connected).
So if I have to do this, I would stick with a polling scenario (timer) like you described, too.