• Advertisement


This topic is now archived and is closed to further replies.

[java] Multicast Channels

This topic is 5118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It it possible to have a DatagramChannel send and receive multicast messages? I tried this group = new InetSocketAddress(InetAddress.getByName(""),5000); channel = DatagramChannel.open(); channel.configureBlocking(false); channel.socket().setReuseAddress(true); channel.socket().setBroadcast(true); channel.socket().bind(group); channel.register(selector, SelectionKey.OP_READ); The bind get and exception "java.net.BindException: Cannot assign requested address: bind" I understand the error I''m just not setting up the socket correctly. Since the channel.socket() only returns a DatagramSocket and not MulticastSocket I''m thinking you can''t except why is there a setBroadcast() method? I''ve been searching the net for the past hour with no luck. All of my existing network code uses Channels and I would like to avoid just using a non-channeled MulticastSocket if possible. Any ideas?

Share this post

Link to post
Share on other sites

  • Advertisement