ajax server design question  
Author Message
Jimmy





PostPosted: 2005-12-30 14:06:00 Top

java-programmer, ajax server design question I am going to write a multi-player board game (I've actually already
written one version, with a java server and VB client). I'd like the
players to be able to play over the web, through an ajax client. I
don't know much about ajax yet. It appears that the XMLHttpRequest (or
whatever it is called) can only generate GET and POST requests through
the http protocol. In that case, I am going to have to either
a) write a server that understands http (maybe not too hard with java's
built-in classes)
or
b) use servlets w/tomcat or some other framework that will handle the
http for me and have the servlet keep a socket connection to the game
server, which speaks its own protocol.

Which should I go for? Also, I am concerned about losing some power by
going to http - like the server is not able to initiate contact with
the client (to notify it of moves made by the other player), and there
is no notification if the client shuts down their window (is that
true?). Is there any better way to accomplish these things than just
having the clients poll the server every 500ms or so?

Thanks for any advice.

 
khakman





PostPosted: 2005-12-31 4:22:00 Top

java-programmer >> ajax server design question Re: Keeping alive the HTTP connection, see http://www.pushlets.com.
Developers have used this and similar approaches in concert with
TIBCO's AJAX framework called TIBCO General Interface to create a
persistent HTTP connection.

Kevin Hakman,
TIBCO

Jimmy wrote:
> I am going to write a multi-player board game (I've actually already
> written one version, with a java server and VB client). I'd like the
> players to be able to play over the web, through an ajax client. I
> don't know much about ajax yet. It appears that the XMLHttpRequest (or
> whatever it is called) can only generate GET and POST requests through
> the http protocol. In that case, I am going to have to either
> a) write a server that understands http (maybe not too hard with java's
> built-in classes)
> or
> b) use servlets w/tomcat or some other framework that will handle the
> http for me and have the servlet keep a socket connection to the game
> server, which speaks its own protocol.
>
> Which should I go for? Also, I am concerned about losing some power by
> going to http - like the server is not able to initiate contact with
> the client (to notify it of moves made by the other player), and there
> is no notification if the client shuts down their window (is that
> true?). Is there any better way to accomplish these things than just
> having the clients poll the server every 500ms or so?
>
> Thanks for any advice.