import java.net.*; /** * Simple multicaster * @author (c)2013 JBY */ public class Sender { public static void main(String args[]) { try { String s = "Bonjour la compagnie"; DatagramSocket ms = new DatagramSocket(); InetAddress ia = InetAddress.getByName("225.1.2.4"); DatagramPacket dp = new DatagramPacket(s.getBytes(),s.getBytes().length,ia,28888); ms.send(dp); System.out.println("Sent at"); } catch(Exception e) { e.printStackTrace(); } } }