Re: Multicast-Socket and JavaScript

Simon <[email protected]> Tue, 11 Nov 2008 09:36:40 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.nspr
Organization http://groups.google.com
Message-ID <6dbb7446-8342-4ad7-875e-300d41b96c45@i18g2000prf.googlegroups.com>
On 10 Nov., 20:16, Wan-Teh Chang <[email protected]> wrote:
> On Mon, Nov 10, 2008 at 9:14 AM, Simon <[email protected]> wrote:
> > Hello,
>
> > my application should have a form of push-service. So I decided to get
> > the xml-messages from the server over multicast in my intranet. In the
> > NSPR API I read something about "mcast", but not a lot. So I have two
> > questions:
> > - can I join to a multicast session from JavaScript or need I c++?
> > - where can I found more information about this topic? (C++ or
> > JavaScript)
>
> NSPR supports multicast.  It's an area I'm unfamiliar with.  I only
> remember there are socket options you can set to join or leave
> a multicast session.
>
> NSPR is a C API, so you can definitely call it from C++.  I don't
> know if you can call the NSPR multicast functions from JavaScript.

OK, very nice. Today I read a lot about it and it seems I could
realize it on this way. My idea is now:
I create two classes: xmlMulticastSocket and
xmlMulticastSocketListener. If the xmlMulticastSocketListener (runs in
a second thread) gets the xml-file completely it should fire an
nsIDOMDataContainerEvent. This Event would be handled by a JavaScript
function (So the multicastSocket is also created with javascript). My
Question is: How "fire" I the event in c++? I think to make an
instance of an event isn't enough, is it?

It would be nice to help me again... Thanks a lot!

Simon