Jump to content
  • Advertisement


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


[java] Multicast Channels

This topic is 5238 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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!