Skip to content

Instantly share code, notes, and snippets.

@mattieb
Created April 2, 2013 17:46
Show Gist options
  • Save mattieb/5294450 to your computer and use it in GitHub Desktop.
Save mattieb/5294450 to your computer and use it in GitHub Desktop.
Just a silly little test of Java multicasting.
import java.net.*;
class Sender {
public static void main(String[] args) throws Throwable {
MulticastSocket socket = new MulticastSocket(new InetSocketAddress(InetAddress.getByName("10.42.0.3"), 9999));
InetAddress groupAddress = InetAddress.getByName("239.192.0.1");
socket.send(new DatagramPacket(new byte[0], 0, groupAddress, 9999));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment