FlyComet for Silverlight

Silverlight is an interesting RichUI for delivering applications over the web. Silverlight also has an option for socket communications starting from 4031 etc., for about 30 ports. So we also have the option of delivering live updates for silverlight over network sockets which would be very efficient live updates.

But currently we are restricting ourselves with a push option from IIS Comet architecture with one extended benefit. We need not be worried about opening the ports and just deliver the live updates over port 80 which saves a lot of support effort for many application owners.

Silveright Extension:

The silverlight extension for flycomet implements the standard protocol of

  • Invoke Connect to get the request id
  • Subscribe to subscribe to a channel
  • Keep polling for any updates fromm server
  • Deliver any updates through a delegate LiveUpdateDelegate.

Using the FlyComet Silverlight extension:

Follow the steps to use flycomet in silverlight.

  1. Create a silverlight project
  2. Include Flycomet.dll from our main flycomet project
  3. Add the http handlers entry in web.config under system.web as follows
    < httpHandlers >
    < add verb=”*” path=”/FlyCometHandler.ashx” type=”FlyComet.FlyCometHandler” />
    </ httpHandlers >
  4. Add the FlyCometSilverlight.dll into the silverlight project.
  5. Add the following code snippet.
    FlyCometSilverlight fs = null;
    fs = new FlyCometSilverlight(this);
    fs.Connected += new FlyCometSilverlight.ConnectionDelegate(fs_Connected);
  6. The above will ensure we have connected to flycomet
  7. Use the following snippet to subscribe to a channel. Please remember we still do not support a full fledged nested channeling protocol.
  8. Receive all the live updaets by subscribing to liveupdate event.
    fs.LiveUpdateReceived += new FlyCometSilverlight.LiveUpdateDelegate(fs_LiveDataReceived);

Now use FlyComet Publisher project to publish messages to the desired channel and we should be receiving data.