Mercurial > hg > Members > riono > TreeVNC_ja_comment
comparison src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java @ 335:49e25659ad05
remove socketClose, close unused viewer -d mode.
author | oc |
---|---|
date | Fri, 06 Feb 2015 11:08:33 +0900 |
parents | 42fcc9419498 |
children | b3ef6d14b2b7 |
comparison
equal
deleted
inserted
replaced
334:dff2f92ae3ff | 335:49e25659ad05 |
---|---|
45 soc.joinGroup(mAddr); | 45 soc.joinGroup(mAddr); |
46 soc.setTimeToLive(1); | 46 soc.setTimeToLive(1); |
47 } catch (IOException e) { | 47 } catch (IOException e) { |
48 System.out.println("cannot create FindRoot socket."); | 48 System.out.println("cannot create FindRoot socket."); |
49 e.printStackTrace(); | 49 e.printStackTrace(); |
50 socketClose(); | |
51 } | 50 } |
52 } | 51 } |
53 | 52 |
54 /** | 53 /** |
55 * send find root message. | 54 * send find root message. |
70 try { | 69 try { |
71 soc.send(sendPacket); | 70 soc.send(sendPacket); |
72 } catch (IOException e) { | 71 } catch (IOException e) { |
73 System.out.println("cannot send FindRoot packet."); | 72 System.out.println("cannot send FindRoot packet."); |
74 e.printStackTrace(); | 73 e.printStackTrace(); |
75 socketClose(); | |
76 } | 74 } |
77 | 75 |
78 } | 76 } |
79 | 77 |
80 public String textPort() { | 78 public String textPort() { |
82 } | 80 } |
83 | 81 |
84 void socketClose() { | 82 void socketClose() { |
85 try { | 83 try { |
86 rootSelectionPanel.unVisible(); | 84 rootSelectionPanel.unVisible(); |
87 if (is != null) | 85 is.close(); |
88 is.close(); | |
89 if (soc != null) | |
90 soc.close(); | |
91 } catch (IOException e) { | 86 } catch (IOException e) { |
92 e.printStackTrace(); | 87 e.printStackTrace(); |
93 System.out.println("cannot is close."); | 88 System.out.println("cannot is close."); |
94 } | 89 } |
95 } | 90 } |
120 } | 115 } |
121 if(proxyAddr2!=null) | 116 if(proxyAddr2!=null) |
122 rootSelectionPanel.checkBox(proxyAddr2); | 117 rootSelectionPanel.checkBox(proxyAddr2); |
123 rootSelectionPanel.setButton(); | 118 rootSelectionPanel.setButton(); |
124 rootSelectionPanel.visible(); | 119 rootSelectionPanel.visible(); |
125 setStopFlag(true); | |
126 } | 120 } |
127 } catch (IOException e) { | 121 } catch (IOException e) { |
128 System.out.println("an I/O error occurs " + e.getMessage()); | 122 System.out.println("an I/O error occurs " + e.getMessage()); |
129 socketClose(); | |
130 } | 123 } |
131 } | 124 } |
132 | 125 |
133 public void setStopFlag(boolean stopFlag) { | 126 public void setStopFlag(boolean stopFlag) { |
134 this.stopFlag = stopFlag; | 127 this.stopFlag = stopFlag; |