Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Multicast channels...?

Reply
Thread Tools

Multicast channels...?

 
 
SabaUd
Guest
Posts: n/a
 
      02-24-2008
Hello,
I have an application that is using many DatagramChannels, and
registers them to a Selector.
Now, I want to add a multicast communication to the application.
The MulticastSocket extends the DatagramSocket, but there seem to be
no "MulticastChannel".
The DatagramChannel.open() method creates a channel with a
DatagramSocket.
Is there anyway to "set" the wanted socket for the channel? Or is
there any Channel that can be defined in the socket it opens?

Thank's
Udi
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      02-24-2008
On Sun, 24 Feb 2008 01:21:50 -0800 (PST), SabaUd wrote:
> Now, I want to add a multicast communication to the application. The
> MulticastSocket extends the DatagramSocket, but there seem to be no
> "MulticastChannel".


Create a MulticastSocket with the desired properties and call
getChannel() to get the channel for it.

/gordon

--
 
Reply With Quote
 
 
 
 
SabaUd
Guest
Posts: n/a
 
      02-24-2008
> Create a MulticastSocket with the desired properties and call
> getChannel() to get the channel for it.


Can't... The getChannel() method returns the channel associated with
the socket if (and only if) the channel was created with the
DatagramChannel.open() method. Otherwise the method returns null...
 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      02-24-2008
On Sun, 24 Feb 2008 04:03:39 -0800 (PST), SabaUd wrote:
>> Create a MulticastSocket with the desired properties and call
>> getChannel() to get the channel for it.

>
> Can't... The getChannel() method returns the channel associated with
> the socket if (and only if) the channel was created with the
> DatagramChannel.open() method. Otherwise the method returns null...


Hmm sorry. Strange though that MulticastSocket inherits the
getChannel() method from DatagramSocket when there is (AFAIK) no other
way to create the necessary channel.

This might offer more insight into the situation:
http://blogs.sun.com/alanb/entry/multicasting_with_nio

/gordon

--
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPRIP could not join the multicast group 224.0.0.9 =?Utf-8?B?U2NvdA==?= Wireless Networking 0 12-12-2004 07:29 PM
QOS for multicast P Cisco 0 10-19-2003 12:26 AM
multicast in msmq 3.0 Vladik ASP .Net 0 09-09-2003 11:42 AM
Multicast on Catalyst 2950 Rick Cisco 2 07-25-2003 01:34 PM
Broadcast and Multicast problem sPiDEr Cisco 3 07-11-2003 07:41 AM



Advertisments