@@ -0,0 +1,2046 @@
+package tp4_reseau;%0A%0Aimport java.awt.event.KeyAdapter;%0Aimport java.awt.event.KeyEvent;%0Aimport java.io.IOException;%0Aimport java.net.DatagramPacket;%0Aimport java.net.InetAddress;%0Aimport java.net.MulticastSocket;%0Aimport java.net.UnknownHostException;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0Apublic class ClientChatMulticast %7B%0A%09final public static int PORT = 2000;%0A%09final public static String HOST = %22238.0.0.23%22;%0A%09%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%0A        final FenetreChat fc = new FenetreChat(%22La folie du chat%22);%0A        %0A        final MulticastSocket socket = new MulticastSocket(PORT);%0A        socket.joinGroup(InetAddress.getByName(HOST));%0A        %0A        fc.capturerEntree(new KeyAdapter() %7B%0A            @Override%0A            public void keyPressed(KeyEvent e) %7B%0A                if(e.getKeyCode() == KeyEvent.VK_ENTER)%7B%0A                    byte%5B%5D msg = fc.getMessage().getBytes();%0A                    try %7B%0A                        DatagramPacket packet = new DatagramPacket(%0A                                msg,%0A                                msg.length,%0A                                InetAddress.getByName(HOST),%0A                                PORT%0A                        );%0A                        socket.send(packet);%0A                        fc.effacerChampEnvoi();%0A                    %7D catch (UnknownHostException ex) %7B%0A                        Logger.getLogger(ClientChatMulticast.class.getName()).log(Level.SEVERE, null, ex);%0A                    %7D catch (IOException ex) %7B%0A                        Logger.getLogger(ClientChatMulticast.class.getName()).log(Level.SEVERE, null, ex);%0A                    %7D%0A                %7D%0A            %7D%0A        %7D);%0A        %0A        byte%5B%5D buff = new byte%5B256%5D;%0A        DatagramPacket packet = new DatagramPacket(buff, buff.length);%0A        %0A        for(;;)%7B%0A            socket.receive(packet);%0A            String msg = new String(packet.getData(), packet.getOffset(), packet.getLength());%0A            fc.afficherMessage(msg);%0A        %7D%0A    %7D%0A%0A%7D%0A

Create ClientChatMulticast.java