@@ -0,0 +1,1269 @@
+package tp4_reseau;%0A%0Aimport java.io.IOException;%0Aimport java.net.DatagramPacket;%0Aimport java.net.DatagramSocket;%0Aimport java.net.InetSocketAddress;%0Aimport java.util.GregorianCalendar;%0A%0Apublic class ServerUdpdaytime %7B%0A%09private int port;%0A%09private int nbClients;%0A%09%0A%09public ServerUdpdaytime(int port, int nbClients) %7B%0A%09%09this.port = port;%0A%09%09this.nbClients = nbClients;%0A%09%7D%0A%09%0A%09public ServerUdpdaytime() %7B%0A%09%09this.port = 5003;%0A%09%09this.nbClients = 100;%0A%09%7D%0A%09%0A%09public void lancer() %7B%0A%09%09byte%5B%5D buf = new byte%5B512%5D;%0A%09%09try %7B%0A%09%09%09DatagramSocket socket = new DatagramSocket(port);%0A%09%09%09DatagramPacket packetReceive = new DatagramPacket(buf,%0A%09%09%09buf.length);%0A%09%09%09String chaineDate;%0A%09%09%09System.out.println(%22Serveur daytime lanc%C3%A9 sur : %22 + port);%0A%09%09%09for (int i = 1; i %3C= nbClients; i++) %7B%0A%09%09%09%09socket.receive(packetReceive);%0A%09%09%09%09chaineDate = new%0A%09%09%09%09GregorianCalendar().getTime().toString();%0A%09%09%09%09DatagramPacket packetSend = new DatagramPacket(%0A%09%09%09%09chaineDate.getBytes(),%0A%09%09%09%09chaineDate.getBytes().length,%0A%09%09%09%09packetReceive.getAddress(),%0A%09%09%09%09packetReceive.getPort());%0A%09%09%09%09socket.send(packetSend);%0A%09%09%09%7D%0A%09%09%09socket.close();%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%09public static void main(String%5B%5D args) %7B%0A%09%09ServerUdpdaytime server = new ServerUdpdaytime();%0A%09%09server.lancer();%0A%09%7D%0A%7D%0A

Create ServerUdp.java