Author: ron.sigal(a)jboss.com
Date: 2009-04-11 21:44:36 -0400 (Sat, 11 Apr 2009)
New Revision: 4968
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetectorMBean.java
Log:
JBREM-1099: Added bufferSize attribute.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java 2009-04-09
19:02:54 UTC (rev 4967)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java 2009-04-12
01:44:36 UTC (rev 4968)
@@ -59,6 +59,7 @@
private int port = 2410;
private MulticastSocket socket;
private Listener listener = new Listener("Remoting Multicast Detector - Listener
Thread: " + threadCounter++);
+ private int bufferSize = 10000;
/**
@@ -137,6 +138,17 @@
this.port = port;
}
+
+ public int getBufferSize()
+ {
+ return bufferSize;
+ }
+
+ public void setBufferSize(int bufferSize)
+ {
+ this.bufferSize = bufferSize;
+ }
+
/**
* called by MBeanServer to start the mbean lifecycle
*
@@ -347,7 +359,8 @@
public void run()
{
- byte[] buf = new byte[4000];
+ log.debug("using bufferSize: " + bufferSize);
+ byte[] buf = new byte[bufferSize];
DatagramPacket p = new DatagramPacket(buf, 0, buf.length);
//p.setAddress(addr);
//p.setPort(port);
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetectorMBean.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetectorMBean.java 2009-04-09
19:02:54 UTC (rev 4967)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetectorMBean.java 2009-04-12
01:44:36 UTC (rev 4968)
@@ -84,5 +84,15 @@
* @param defaultIP The IP that is used to broadcast detection messages on via
multicast.
*/
void setDefaultIP(String defaultIP);
+
+ /**
+ * @return The size of the byte array in the DatagramPacket.
+ */
+ int getBufferSize();
+
+ /**
+ * @param bufferSize The size of the byte array in the DatagramPacket.
+ */
+ void setBufferSize(int bufferSize);
}
Show replies by date