mardi 27 janvier 2015

Mini Chat : Subscription for refresh

I am trying to design a mini-chat for my website


I am almost ready to go but I'm not sure about my refresh method.


My first thought is to use something like :



// Call the refresh method every 30sec.
setInterval(refresh,30*1000);


But I remember some articles about managing some kind of subscription in a web app.


Someting like this :



CLIENT SERVER
| |
onConnection ----- Subsribe -------> |
| |
| <---------- Notify ------ onUpdate
| |
onQuit ------ Unsubscribe ------> |


Do you have any help / tutorials ?


I found this ressource, but I'm not sure I can use the SIP protocol in my website : RFC 6665 - Section 3 - SIP Methods for Event Notification




Other ressources I found :






Aucun commentaire:

Enregistrer un commentaire