import java.net.*; /** * Simple broadcaster * @author (c)2013 JBY */ public class Sender { public static void main(String args[]) { try { String s = "Ca va Paris ?"; DatagramSocket ds = new DatagramSocket(); DatagramPacket dp = new DatagramPacket(s.getBytes(),s.getBytes().length,new InetSocketAddress("255.255.255.255",60123)); ds.send(dp); } catch(Exception e) { e.printStackTrace(); } } }