• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX,WebSockets, XMPP?

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Imagine a online-game with two players (clients).

What is the best technique to guarantee
that these two players are able to play interactivately,
that means player 1 sees the changes of player 2 immediately and both can react simultaneously ("real-time communication").

I guess, AJAX (DWR, Direct Web Remoting) is too slow.
So should I go for WebSockets or XMPP or JMS(Java Messaging Service) or SERVLET API 3.0 (with its "COMET-API")
or is there another techinque which is the right thing for that kind of web-application?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a whole bunch of acronyms that are only vaguely related to each other, and if it's a *web* app, a couple aren't even applicable unless you're using an applet.

Have you *proven* that Ajax doesn't work they way you need it to?

Define "immediately", since it's *obvious* "immediate" is impossible, regardless of *any* method you use.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello David,

actually I am trying/learning WebSockets by using JETTY-Servlet-Container
(which has built-in support for WebSockets).

Unfortunately, there is no XMPP-Server-Support for any Servlet-Based-Container
(such as Tomcat/Jetty, JBoss, Glashfish,..), so I need to have an additional XMPP-Server
(http://www.saint-andre.com/jabber/jsc/) running simultanously with my JETTY.
That is annoying. So I guess, I do not use XMPP and use WebSockets instead.


Have you *proven* that Ajax doesn't work they way you need it to?



I have been using ajax quite often without problems.
However, I want to give a try to use WebSockets or XMPP instead of Ajax (or Comet)
as I want to have a web based real-time-application.

Bye.

 
Author
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Nimo,

I believe there is a misunderstanding here. WebSockets is not a replacement or a better Ajax. You should look at WebSockets the same way you look at a TCP socket. Instead of coding against the WebSocket APIs directly, you should use a protocol client such as XMPP that has been built on top of the WebSocket API. This will let you communicate directly with the XMPP server from the browser via a WebSocket-enabled server (if the server has been properly designed).

A demo example of how this can be done you can see here - http://www.kaazing.me This site shows how you can use XMPP over WebSockets to communicate with Google Talk (hint: use your Google account to login and chat).

Or, you can read this article - http://www.sys-con.com/node/779407 - which covers this topic well.

Cheers,
Jonas
Author Pro JSF and Ajax
 
reply
    Bookmark Topic Watch Topic
  • New Topic