Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to join a Multicast Group

Java: How to join a Multicast Group
{filelink=9005}

import java.net.InetAddress;
import java.net.MulticastSocket;
public class MulticastGroupExample
{
  public static void main(String[] argv) throws Exception
  {
  MulticastSocket multi_sock = new MulticastSocket(655);
  // Join a multicast group
  InetAddress ia = InetAddress.getByName("224.10.2.3.5");
  multi_sock.joinGroup(ia);
  byte[] buff = new byte[1024];
  while (true)
  {
    DatagramPacket dp = new DatagramPacket(buff, buff.length);
    multi_sock.receive(dp);
    String msg= new String(dp.getData( ), "ISO_8859_1");
    System.out.println("Received data: "+msg);
  }
}
  }

Users who found this page were searching for:

  • xml+files+for+multicast+groups+in+java
  • how to parce a excel.xml python
  • how java multicast join group is imlemented
  • how to join multicast group in python example
  • java scriptengine python example
  • java multicast join group
  • joining multicast group java
  • perl multicast example
  • multicast group Java Example
  • python using dictionary

No comments yet.

Leave a Comment