7 * main for testing ClientSimplifie
9 private static void main1() {
10 ClientSimplifie client
= null;
11 BufferedReader userInput
= null;
14 client
= new ClientSimplifie();
15 userInput
= new BufferedReader(new InputStreamReader(System
.in
));
18 String line
= userInput
.readLine();
22 String rline
= client
.receiveMsg();
23 System
.out
.println(rline
);
26 catch (IOException e
) {
27 System
.err
.println("IOException: " + e
);
31 if (userInput
!= null) {
35 catch (IOException e
) {
36 System
.err
.println("IOException: " + e
);
43 * main for text based message broadcasting
45 public static void main2() {
46 SocketClient client
= null;
51 client
= new SocketClient();
52 thS
= new Thread(new ThreadClientSend(client
));
53 thR
= new Thread(new ThreadClientReceive(client
));
60 System
.err
.println("Exception: " + e
);
67 catch (InterruptedException e
) {
68 System
.err
.println("InterruptedException: " + e
);
75 public static void main(String
[] args
) {
76 SocketClient client
= null;
81 client
= new SocketClient(true);
82 thS
= new Thread(new ThreadClientoSend(client
));
83 thR
= new Thread(new ThreadClientoReceive(client
));
90 System
.err
.println("Exception: " + e
);
97 catch (InterruptedException e
) {
98 System
.err
.println("InterruptedException: " + e
);