Reputation: 501
I believe that this is something a lot of people want to do but that isn't clearly explained anywhere that I have found.
I am developing a penny auction site for a client and I need to build it so that everyone sees an accurate auction timer that is synced between users. Through research I have come to the conclusion that I need to set up a socket server.
I know very little about this and was hoping someone could explain how this functionality should be set up.
Upvotes: 0
Views: 816
Reputation: 23552
Maybe you think a little complicated here. A simple Javascript countdown should do the trick. Place it on the top of the document and start it right away (not on page load) and it should be more or less in sync on every client. It's not 100% accurate but it works for ebay.
Add an ajax refresh to resync it if you fell the need to.
Consider all clients actions delayed by the internet anyway so even if the timer is a whole 1 second off it should not make a big difference.
Upvotes: 1