@@ -0,0 +1,1288 @@
+package reseau_tp_1;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.BufferedWriter;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.io.OutputStreamWriter;%0Aimport java.net.InetSocketAddress;%0Aimport java.net.Socket;%0Aimport java.util.Scanner;%0A%0Apublic class ClientTCPEcho %7B%0A%09private String hostname;%0A%09private int port;%0A%09public ClientTCPEcho(String hostname,int port) throws IOException%7B%0A%09%09this.hostname = hostname;%0A%09%09this.port = port;%0A%09%09lancerBW();%0A%09%7D%0A%09%0A%09private void lancerBW() throws IOException%7B%0A%09%09String ligne;%0A%09%09Socket sockClient = new Socket();%0A%09%09sockClient.connect(new InetSocketAddress(this.hostname, this.port));%0A%09%09BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(sockClient.getOutputStream()));%0A%09%09Scanner sc = new Scanner(System.in);%0A%09%09System.out.println(%22Saisir une cha%C3%AEne : %22);%0A%09%09ligne = sc.nextLine();%0A%09%09sc.close();%0A%09%09bw.write(ligne);%0A%09%09bw.newLine();%0A%09%09bw.flush();%0A%09%09BufferedReader br = new BufferedReader(new InputStreamReader(sockClient.getInputStream()));%0A%09%09while((ligne = br.readLine())!=null)%0A%09%09%09System.out.println(ligne);%0A%09%09br.close();%0A%09%09sockClient.close();%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09ClientTCPEcho client = new ClientTCPEcho(%22allegro%22,7);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Create client_tcp_echo.java