Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

  • bartczernicki

    bartczernicki

    Contributor

    5212 Points

    953 Posts

    Re: Another WCF polling/duplex question. How to send a "broadcast" message?

    Oct 18, 2008 05:41 AM | LINK

    Sockets might be a better option (if you can use it).  I have seen a demo of a teacher-student prototype (nothing fancy) where the lecture is given on one Silverlight main screen and the other clients (students) all receive the same view.  Behind the scenes all that is happening is that the mouse coordinates are being sent to the students and everyone has the same app just that the teacher is "controlling" what the client sees.  There was another demo of basketballs scores using sockets for this kind of broadcasting type scenario as well.

    In your scenario, I wonder if you can somehow send a kill/dispose command to the service via a Javascript AJAX call to your main service to tell it someone is closing the browser.  I have never implemented this type of thing, but I would guess that WCF Duplex Service has some data structure for maintaining the list of clients it is sending messages too.

    I am leaving the option that there just might be something you can do with the code (maybe there is a bug on your end) and not get that hang up.  I know the WCF Duplex support is not the true duplex in WCF 3.x, so there might be some weird anomalys.

    Don't forget to "Mark as Answer"
    Bart Czernicki
    http://www.silverlighthack.com | My new Silverlight and Business Intelligence Book