Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 258:fbd792d91055
add exception handling for case of a network interface don't have corresponding to the Multicast.
author | oc |
---|---|
date | Mon, 01 Dec 2014 17:06:36 +0900 |
parents | 11b59b223222 |
children | 606953a43198 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Mon Dec 01 17:03:27 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Mon Dec 01 17:06:36 2014 +0900 @@ -31,7 +31,11 @@ InetAddress mAddr = InetAddress.getByName(McastAddr); soc = new MulticastSocket(ConnectionParams.DEFAULT_VNC_ROOT_FINDER); DatagramPacket recvPacket = new DatagramPacket(buf, BufSize); - soc.joinGroup(mAddr); + try { + soc.joinGroup(mAddr); + } catch (Exception e) { + // Ignore case of a network interface don't have corresponding to the Multicast. + } while (!stopFlag) { soc.receive(recvPacket); String hostname = recvPacket.getAddress().getHostAddress();