offset += 4; //uniqueId length
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
offset += data.uniqueId.length; //uniqueId data
- byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
+ //byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
+ int addrlen = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //addr length
- System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
- data.setAddress(MemberImpl.getMember(addr));
- offset += addr.length; //addr data
+ //System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
+ data.setAddress(MemberImpl.getMember(xbuf.getBytesDirect(),offset,addrlen));
+ //offset += addr.length; //addr data
+ offset += addrlen;
int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //xsize length
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
return getMember(data,new MemberImpl());
}
+ public static MemberImpl getMember(byte[] data, int offset, int length) {
+ return getMember(data,offset,length,new MemberImpl());
+ }
+
/**
* Return the name of this object
* @return a unique name to the cluster
try { key.channel().close(); } catch (IOException e) { if (log.isDebugEnabled()) log.debug("", e); }
}
-
+ protected long lastCheck = System.currentTimeMillis();
protected void socketTimeouts() {
+ long now = System.currentTimeMillis();
+ if ( (now-lastCheck) < getSelectorTimeout() ) return;
//timeout
Selector tmpsel = selector;
Set keys = (isListening()&&tmpsel!=null)?tmpsel.keys():null;
if ( keys == null ) return;
- long now = System.currentTimeMillis();
for (Iterator iter = keys.iterator(); iter.hasNext(); ) {
SelectionKey key = (SelectionKey) iter.next();
try {
cancelledKey(key);
}
}
+ lastCheck = System.currentTimeMillis();
}
suite.addTestSuite(org.apache.catalina.tribes.test.membership.TestMemberArrival.class);
suite.addTestSuite(org.apache.catalina.tribes.test.membership.TestTcpFailureDetector.class);
suite.addTestSuite(org.apache.catalina.tribes.test.channel.TestDataIntegrity.class);
+ suite.addTestSuite(org.apache.catalina.tribes.test.interceptors.TestOrderInterceptor.class);
return suite;
}
}
boolean first = true;
int count = 0;
DecimalFormat df = new DecimalFormat("##.00");
- while ( count<100000 ) {
+ while ( count<1000000 ) {
if ( first ) { first = false; start = System.currentTimeMillis();}
out.write(buf,0,buf.length);
mb += ( (double) buf.length) / 1024 / 1024;