This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

response without request

 
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Suppose there are number of clients (browsers) connected with the server (one to one communication is happening between each client and server).

Now some time what I want to achieve is, if one client send a request, response of that request should be sent to all the clients.

I am sure, response without request is not possible so I guess, and I will need dummy request from all the clients to send that response�

It�s happening but �timing� is BIG issue. I want other clients to send dummy requests only when one of the clients has sent an �original request� or I should ignore all the dummy requests until I get an �original request� from any of the client...

Second option seems possible.

Please post your views on the same.

Thanks.
[ April 27, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTTP is a stateless protocol.

Once a client makes a reqeust and the server responds, the connection is severed. Except for this brief instant while this is going on, there are no clients connected to the server.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do this using server push. For more information on server push visit Push Servlet or do a google search. I have used server push a long time back in a project. If you have any doubt, regarding implementation, please get back to me.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All "clients" will have to be polling the servlet to see if new information is available. Looks like a job for Javascript to me - possibly the AJAX or similar approach.

Bill
 
ankur rathi
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
HTTP is a stateless protocol.

Once a client makes a reqeust and the server responds, the connection is severed. Except for this brief instant while this is going on, there are no clients connected to the server.



Sorry for delaying in follow up.

And one more sorry but I didn't quite understood this? Container runs many threads at the same time, each serving one client. So all threads can use a common place to talk...

And moreover how it is related to my question?
:roll:
 
ankur rathi
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by William Brogden:
All "clients" will have to be polling the servlet to see if new information is available. Looks like a job for Javascript to me - possibly the AJAX or similar approach.

Bill



Exactly, I thought the same. So I said "dummy request". It's kind of pulling only...
[ May 07, 2007: Message edited by: ankur rathi ]
 
ankur rathi
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is one sample of implementation:

http://gossips.s42.eatj.com/login.jsp

You can use any of the following username and password:

temp1/temp1
temp2/temp2
temp3/temp3
temp4/temp4
temp4/temp5

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic