Sign in to follow this  
Legendre

Websocket/Socket.io vs AJAX-Push (CometD, APE etc)

Recommended Posts

I have been making a two players modified chess game on and off as a hobby for a while now, and learned some HTML, CSS, Javascript, PHP, MySQL, AJAX along the way. So far I have wrote a login page, an javascript "engine" to draw and move the chessboard + pieces using the HTML5 Canvas element, and a primitive chat system that uses XMLHttpRequest to update the chat every few seconds.

Now comes the multi-player: Players can move their pieces in real time. So, I need the moves of one player to be "near-instantly" displayed on the browser of the other. I suppose I will need to use one of the two options:

1) HTML5 Websockets via Socket.io
2) AJAX-Push, probably via APE or CometD

I am tempted to go with Socket.io simply because it has been so hyped for developing browser games. But I read that there are cases where Comet (AJAX-Push) is actually a better option?

Share this post


Link to post
Share on other sites
I have decided to go for AJAX Push because it has been around longer, and there are more resources/tutorials for it.

Fiddled around with Socket.io and Node.js for a while, and read somewhere that probably only 5-20 people completed games using socket.io and node.js lol. I understand there are open source socket.io game codes out there (e.g. browser quest) but the lack of tutorials and help is troubling.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this