3

I am currently working on an online presentation tool. Consider the following scenario:

  • Someone gives a presentation
  • another person connects to watch said presentation
  • >> I want to update the watcher's view when the presenter changes the slide

what would be the better approach?

  1. forcing the connection to stay open to send updates onSlideChange
  2. periodically (every second or so) letting the client request an update
  3. something else I am not aware of

Thanks!

msturdy
  • 10,479
  • 11
  • 41
  • 52
tpei
  • 671
  • 9
  • 26
  • 3
    If websockets are out of the question here, then ajax long polling will do it: http://stackoverflow.com/questions/333664/simple-long-polling-example-code – Twisted1919 Dec 03 '13 at 10:38
  • Depending on how the presentation is broadcast there are often 'extra' data values that can be sent. You could include the slide change event as one of these. – ethrbunny Dec 03 '13 at 12:49

1 Answers1

0

I would suggest using websockets for this, however your websocket would have to be a separate application running through a higher level PORT on your server.

There are a few PHP websocket tools out there, have a look at http://socketo.me/ (as this was the first result on google!) or you could write one with PHPs Socket methods, but you will need to do some reading on Websocket standards and handshake decryption.

RaggaMuffin-420
  • 1,762
  • 1
  • 10
  • 14