Mercurial > hg > Applications > TreeVNC
changeset 606:82755931810c
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 19 Feb 2020 15:02:10 +0900 |
parents | b1ace1c5d37a |
children | 8f270c9d0d4c |
files | src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java |
diffstat | 2 files changed, 9 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Tue Feb 18 21:47:17 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Wed Feb 19 15:02:10 2020 +0900 @@ -16,7 +16,7 @@ public class BroadcastRFBListener implements Runnable { public static final String Ipv4McastAddr = "224.0.0.1"; - public static final String Ipv6McastAddr = "ff02::1"; + public static final String Ipv6McastAddr = "ff02::1"; // we don't have to send IPv6, multicast on IPv4 is enough public static String McastAddr = Ipv4McastAddr; static final int BufSize = 1024*64; @@ -24,7 +24,6 @@ private boolean stopFlag = false; private TreeRFBProto rfb; private MulticastSocket soc; - private SecurityManager securityManager; public BroadcastRFBListener() { try { @@ -42,12 +41,7 @@ } catch (SocketException e) { System.out.println("join to " + Ipv4McastAddr + " failed."); } - /*try { - soc.joinGroup(InetAddress.getByName(Ipv6McastAddr)); - } catch (SocketException e) { - System.out.println("join to " + Ipv6McastAddr + " failed."); - }*/ - return soc; + return soc; } /** @@ -74,17 +68,12 @@ } } + /** + * send multicsst frame buffer update + * the multicast is sent to all network interfaces supporting multicast + * @param buf + */ public void multicastUpdateRectangle(ByteBuffer buf) { - - /*try { - DatagramPacket sendPacket = new DatagramPacket(buf.array - (), buf.limit(), InetAddress.getByName(TreeRootFinderListener.Ipv6McastAddr), ConnectionParams.DEFAULT_VNC_BROADCAST); - soc.send(sendPacket); - } catch (IOException e) { - System.out.println("cannot send UpdateRectangle."); - e.printStackTrace(); - }*/ - try { DatagramPacket sendPacket1 = new DatagramPacket(buf.array(), buf.limit(), InetAddress.getByName(TreeRootFinderListener.Ipv4McastAddr), ConnectionParams.DEFAULT_VNC_BROADCAST); soc.send(sendPacket1);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Tue Feb 18 21:47:17 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncCommandChannelListener.java Wed Feb 19 15:02:10 2020 +0900 @@ -112,7 +112,8 @@ // or direct TreeVNC Command from lower node // such as LostParent, LostChild TreeVncCommand cmd = treeVncCommand(b,is,os,myHostAddress,intf); - if (cmd!=null) return cmd; + if (cmd!=null) + return cmd; } // normal connection from TreeVNC node candidate sendSecurityType(os);