Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 325:cc9d33208f34
small change catch error message.
author | oc |
---|---|
date | Sun, 01 Feb 2015 06:44:56 +0900 |
parents | 1b1270adc4ba |
children | 1d4d5055a288 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java |
diffstat | 1 files changed, 25 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sat Jan 31 16:01:14 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Feb 01 06:44:56 2015 +0900 @@ -146,6 +146,8 @@ } } } catch (InterruptedException e) { + e.printStackTrace(); + System.out.println("timer thread interrupt."); } } } @@ -168,15 +170,15 @@ if (permitChangeScreen()) { ByteBuffer buf = ByteBuffer.wrap(b); buf.order(ByteOrder.BIG_ENDIAN); - buf.get(); + buf.get(); // padding buf.get(); short id = buf.getShort(); int length = buf.getInt(); - if (length == 0) - continue; + if (length == 0) + continue; byte[] byteAddress = new byte[length]; buf.get(byteAddress); - String newHostName = new String(byteAddress, "UTF-8"); + String newHostName = new String(byteAddress, "UTF-8"); int frameSizeWidth = buf.getInt(); int frameSizeHeight = buf.getInt(); System.out.println("Root server change request :" + newHostName); @@ -215,13 +217,13 @@ double halfDelay = (double) delay / 2; System.out.println(System.currentTimeMillis() + " : receive checkDelay : nodeNum" + nodeNum + ", port : " + port + ", address : " + address + ", delay : " + halfDelay); } - // case of client node. + // case of client node. } else if (b[0] == ClientToServerMessage.SERVER_CHANGE_REQUEST) { ClientToServerMessage serverChangeRequest = new ClientToServerMessage() { @Override public void send(Writer writer) throws TransportException { - writer.write(b,0,c); + writer.write(b, 0, c); } }; context.sendMessage(serverChangeRequest); @@ -239,7 +241,7 @@ @Override public void send(Writer writer) throws TransportException { - writer.write(b,0,c); + writer.write(b, 0, c); } }; context.sendMessage(readyShareSound); @@ -248,7 +250,7 @@ @Override public void send(Writer writer) throws TransportException { - writer.write(b,0,c); + writer.write(b, 0, c); } }; context.sendMessage(checkDelayReply); @@ -265,6 +267,13 @@ } return; } + + /* + // あとで検討 + } catch (TransportException e) { + + } + */ } } }; @@ -470,10 +479,15 @@ } - public synchronized void waitForVNCConnection() throws InterruptedException { + public synchronized void waitForVNCConnection() { if (reconnectingId!=0) { while (!readyReconnect) { - wait(); + try { + wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + System.out.println("interrupt wait for vnc connection."); + } } } } @@ -747,10 +761,9 @@ * @param height * FrameHeight * @param id - * @throws InterruptedException */ public void changeVNCServer(ViewerInterface vncProxyService, String hostName, int width, int height, short id) - throws UnknownHostException, IOException, InterruptedException { + throws IOException { this.frameSizeWidth = width; this.frameSizeHeight = height;