X-Git-Url: https://git.piment-noir.org/?p=TD_SR.git;a=blobdiff_plain;f=TD2%2FIHM%2FMain.java;fp=TD2%2FIHM%2FMain.java;h=af925f12feb703a67d9821e791cb0b221b3600e4;hp=0000000000000000000000000000000000000000;hb=ef87f1a8633012e6ba3ba20d095a619b7387ab49;hpb=15850b4cdcf949dae5a150a7c209bd1b95061121 diff --git a/TD2/IHM/Main.java b/TD2/IHM/Main.java new file mode 100644 index 0000000..af925f1 --- /dev/null +++ b/TD2/IHM/Main.java @@ -0,0 +1,40 @@ +import java.io.*; + + +public class Main { + + public static void main(String[] args) { + SocketClient client = null; + Thread thS = null; + Thread thR = null; + IHM clientIHM = null; + + try { + clientIHM = new IHM(); + clientIHM.go(); + client = new SocketClient(); + thS = new Thread(new ThreadIHMSend(client, clientIHM)); + thR = new Thread(new ThreadIHMReceive(client, clientIHM)); + thS.setName("thS"); + thS.start(); + thR.setName("thR"); + thR.start(); + } + catch (Exception e) { + System.err.println("Exception : " + e); + e.printStackTrace(); + } + finally { + try { + thS.join(); + thR.join(); + } + catch (InterruptedException e) { + System.err.println("InterruptedException: " + e); + e.printStackTrace(); + } + client.closeRWIO(); + } + } + +}