Added: 1 year ago
From: oscarjgb
Views: 197
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (8)

Sign In or Sign Up now to post a comment!
  • Hi, I'm looking for tutorial how to do it. Can you help me?

  • @zlociisz it's very easy to do it. You must stablish an persistent connection to the web server. You can do it with a XHR object. The PHP script (ASP, JSP or another server side language) only send a byte with the server status on every change. On every byte received by the XHR object it will trigger an event with a readyState of 3 (partial content). You can do something with the byte or message and when you will receive an readyState of 4 (end of document load) you must to reconnect again.

  • @oscarjgb thanks a lot, I managed to do it with cometd.com

  • De lujo man, mantienes conexiones persistentes con el servidor ? Utilizas algun iframe escondido, buen trabajo :) Saludos

  • @kuyos Uso un objeto XHR puro y duro. No uso librerías externas, como AJAX, para impactar lo mínimo posible en el rendimiento de la página. Sí, uso una conexión persistente que entrega, inicialmente, el estado del servicio y posteriormente entrega sólo cambios generando un evento con readyState 3 (contenido parcial) que actualiza el estado y cuando entrega un readyState 4 (final de carga del documento) vuelve a realizar otra conexión para volver a establecer de nuevo la conexión persistente.

  • @kuyos Por cierto, si quieres el código te lo puedo pasar. Inicialmente lo hice como práctica final de Aplicaciones Software y Familias de Productos (ASFP) de la Universidad Rey Juan Carlos, pero no le dieron el visto bueno pq no era lo que ellos necesitaban para una aplicación para PDA que estaban desarrollando. Este año toca repetir asignatura :(

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more