From 6fbefad24ec7e8783365db61b03357d50ee0dd56 Mon Sep 17 00:00:00 2001 From: jestin Date: Fri, 27 Apr 2012 08:55:56 +0000 Subject: added names to the threads, in order to allow jvisualvm debug removed a "My DEBUG" message on the console --- src/IvyWatcher.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/IvyWatcher.java') diff --git a/src/IvyWatcher.java b/src/IvyWatcher.java index 54eca11..cbd3910 100755 --- a/src/IvyWatcher.java +++ b/src/IvyWatcher.java @@ -98,6 +98,7 @@ class IvyWatcher extends Thread { private int port; private volatile Thread listenThread = null; private InetAddress group; + // FIXME should not be static ? (findbugs) private static int serial=0; private int myserial=serial++; private String busWatcherId = null; @@ -114,6 +115,7 @@ class IvyWatcher extends Thread { this.port=port; busWatcherId=bus.getWatcherId(); listenThread = new Thread(this); + listenThread.setName("Ivy Watcher thread for "+domainaddr+":"+port); // create the MulticastSocket try { group = InetAddress.getByName(domainaddr); @@ -199,7 +201,7 @@ class IvyWatcher extends Thread { try { Socket s = new Socket(remotehost,remotePort); s.setReceiveBufferSize(bus.getBufferSize()); - System.out.println("MY DEBUG - buffer size="+s.getReceiveBufferSize()); + //System.out.println("MY DEBUG - buffer size="+s.getReceiveBufferSize()); s.setTcpNoDelay(true); bus.createIvyClient(s,remotePort,false); } catch ( java.net.ConnectException jnc ) { @@ -261,7 +263,9 @@ class IvyWatcher extends Thread { this.data=data; bus = b; packet=new DatagramPacket(data.getBytes(),data.length(),group,port); - new Thread((PacketSender.this)).start(); + Thread t = new Thread((PacketSender.this)); + t.setName("Ivy Packet sender"); + t.start(); } public void run() { traceDebug("PacketSender thread started"); // THREADDEBUG -- cgit v1.1