@@ -0,0 +1,948 @@
+package reseau_tp_1;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.BufferedWriter;%0Aimport java.io.IOException;%0Aimport java.io.OutputStreamWriter;%0Aimport java.net.ServerSocket;%0Aimport java.net.Socket;%0Aimport java.util.GregorianCalendar;%0A%0Apublic class ServerTcp %7B%0A%09private int port;%0A%09%0A%09public ServerTcp(int port) throws IOException%7B%0A%09%09this.port = port;%0A%09%09run();%0A%09%7D%0A%09%0A%09private void run() throws IOException%7B%0A%09%09Socket client;%0A%09%09BufferedWriter out;%0A%09%09BufferedReader in;%0A%09%09ServerSocket server = new ServerSocket(this.port);%0A%09%09for(;;)%7B%0A%09%09%09client = server.accept();%0A%09%09%09out = new BufferedWriter(new OutputStreamWriter(%0A%09%09%09%09%09client.getOutputStream()));%0A%09%09%09String date = new GregorianCalendar().getTime().toString();%0A%09%09%09out.write(date);%0A%09%09%09out.newLine();%0A%09%09%09out.flush();%0A%09%09%09client.close();%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09ServerTcp tcp_server = new ServerTcp(5014);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create server_tcp.java