This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client-side Listener

 
Jeffrey Hunter
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I'm researching an issue which has come up in a JSP/Servlet web application. Specifically, the application requires a real-time communication link between the client and server. So, for example, the client sends a request to the server to run job Foo. The server takes its time, completing job Foo in 3 minutes.

Now, how can the server actively send a completion notice to the client?

Naturally, we're moving beyond the capabilities of a simple HTTP server in order to establish a two-way messaging routine between client and server. I'd like to stay away from a mechanism that simply polls the web server until the job is complete. So, applet, JMS? I'm not sure what the best route to go is, so if anyone has experience with this issue, I'd appreciate suggestions.

Thanks!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XMLHttpRequest() would help you I think....
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Socket programming with applets is not too difficult.
 
Jeffrey Hunter
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, guys. The applet was our immediate solution, but we are after something a bit more efficient. Our goal is to maintain a "connection" between the client-server, and have communication occur in the background. It appears that the XMLHttpRequest object serves exactly this purpose.

Thanks, Eric, for providing this tip.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic