comparison src/main/java/jp/ac/u_ryukyu/treevnc/server/BroadCastProxy.java @ 38:c2f0b6907448

add doc directory
author one
date Thu, 27 Sep 2012 19:32:25 +0900
parents f70008073a03
children
comparison
equal deleted inserted replaced
37:1454d6fe96c1 38:c2f0b6907448
12 12
13 public BroadCastProxy(String _str) { 13 public BroadCastProxy(String _str) {
14 str = _str; 14 str = _str;
15 } 15 }
16 16
17 void createSocket(String addr) { 17 void createSocket(String addr) {
18 while (true) { 18 // while (true) {
19 try { 19 try {
20 Thread.sleep(1000); 20 Thread.sleep(1000);
21 socket = new Socket(addr, port); 21 socket = new Socket(addr, port);
22 os = new PrintStream(socket.getOutputStream()); 22 os = new PrintStream(socket.getOutputStream());
23 os.println(str); 23 os.println(str);
24 os.close(); 24 os.close();
25 socket.close(); 25 socket.close();
26 break; 26 //break;
27 } catch (IOException e) { 27 } catch (IOException e) {
28 System.out.println("Connection faild"); 28 System.out.println("Connection faild");
29 continue; 29 //continue;
30 } catch (InterruptedException e) { 30 } catch (InterruptedException e) {
31 e.printStackTrace(); 31 e.printStackTrace();
32 }
33 } 32 }
33 // }
34 } 34 }
35 } 35 }