• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to notify a client without polling?

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I don't know whether this is the right forum to post this question. My apologizes.

The requirement is I want to notify a client that some data has been changed on the server. HTTP is stateless. I don't want to poll the server using ajax calls.

Is there any way to notify the client?

Thank you all in advance. Good day.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only other options are to use an applet or other technology such as Comet, which maintains an open connection. This is terribly expensive and is not recommended for general use.

I'm always suspicious when someone posts "I don't want to use whatever" without explaining why. So, why do you not want to use polling?
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:I'm always suspicious when someone posts "I don't want to use whatever" without explaining why. So, why do you not want to use polling?

The only reason I said I don't want to use polling is, when I ask this question people generally say to opt for polling mechanism. I know about polling and want to know whether there is any other alternative. To just make sure not to get answers related to polling I mentioned I wont want to go with polling.

Another thing I want to know is how to yahoo, facbook, gmail etc implement chat modules in a web page? Do they maintain push chat servers or the chat servers are polled every moment?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chaitanya karthikk wrote:
Bear Bibeault wrote:I'm always suspicious when someone posts "I don't want to use whatever" without explaining why. So, why do you not want to use polling?

The only reason I said I don't want to use polling is, when I ask this question people generally say to opt for polling mechanism. I know about polling and want to know whether there is any other alternative. To just make sure not to get answers related to polling I mentioned I wont want to go with polling.

Then you should say that. otherwise, you just look clueless.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Then you should say that. otherwise, you just look clueless.
Sure Bear.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chaitanya karthikk wrote:Another thing I want to know is how to yahoo, facbook, gmail etc implement chat modules in a web page? Do they maintain push chat servers or the chat servers are polled every moment?


Open up a tool like Fiddler or Charles and watch the HTTP traffic to see what they do.

Modern day browsers do support sockets.

Eric
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:
Open up a tool like Fiddler or Charles and watch the HTTP traffic to see what they do.

Modern day browsers do support sockets.

Eric


Thank you Eric. I would like to know is there any documentation on how to open sockets from my browser to a server?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I bet google could answer that.

MDN JavaScript Sockets
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I'll look at it.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chaitanya karthikk wrote:Hi all, I don't know whether this is the right forum to post this question. My apologizes.

The requirement is I want to notify a client that some data has been changed on the server. HTTP is stateless. I don't want to poll the server using ajax calls.

Is there any way to notify the client?

Thank you all in advance. Good day.



i think you can also use MQTT protocol, which is the publisher, subscriber protocol. we had used in our project to send push notifications for android. but it has been applied in varied scenarios.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic