String getDiagResponse() { StringBuffer sb = new StringBuffer(); sb.append(local_addr).append(" (").append(group_addr).append(")"); sb.append(" [").append(mcast_addr_name).append(":").append(mcast_port).append("]\n"); // sb.append("Version=").append(Version.version).append(", cvs=\"").append( // Version.cvs).append("\"\n"); sb.append("bound to ").append(bind_addr).append(":").append(bind_port).append("\n"); sb.append("members: ").append(members).append("\n"); return sb.toString(); }
String dumpMessages(HashMap map) { StringBuffer sb = new StringBuffer(); Map.Entry entry; List l; if (map != null) { synchronized (map) { for (Iterator it = map.entrySet().iterator(); it.hasNext(); ) { entry = (Map.Entry) it.next(); l = (List) entry.getValue(); sb.append(entry.getKey()).append(": "); sb.append(l.size()).append(" msgs\n"); } } } return sb.toString(); }
String dumpSocketInfo() throws Exception { StringBuffer sb = new StringBuffer(); sb.append("local_addr=").append(local_addr); sb.append(", mcast_addr=").append(mcast_addr); sb.append(", bind_addr=").append(bind_addr); sb.append(", ttl=").append(ip_ttl); if (sock != null) { sb.append("\nsocket: bound to "); sb.append(sock.getLocalAddress().getHostAddress()).append(":").append(sock.getLocalPort()); sb.append(", receive buffer size=").append(sock.getReceiveBufferSize()); sb.append(", send buffer size=").append(sock.getSendBufferSize()); } if (mcast_sock != null) { sb.append("\nmulticast socket: bound to "); sb.append(mcast_sock.getInterface().getHostAddress()) .append(":") .append(mcast_sock.getLocalPort()); sb.append(", send buffer size=").append(mcast_sock.getSendBufferSize()); sb.append(", receive buffer size=").append(mcast_sock.getReceiveBufferSize()); } return sb.toString(); }