@@ -31,23 +31,27 @@ public class VERIFY_SUSPECT extends Protocol implements Runnable {
31
31
/* ------------------------------------------ Properties ------------------------------------------ */
32
32
33
33
@ Property (description ="Number of millisecs to wait for a response from a suspected member" )
34
- private long timeout =2000 ;
34
+ protected long timeout =2000 ;
35
35
36
36
@ Property (description ="Number of verify heartbeats sent to a suspected member" )
37
- private int num_msgs =1 ;
37
+ protected int num_msgs =1 ;
38
38
39
39
@ Property (description ="Use InetAddress.isReachable() to verify suspected member instead of regular messages" )
40
- private boolean use_icmp =false ;
40
+ protected boolean use_icmp =false ;
41
+
42
+ @ Property (description ="Send the I_AM_NOT_DEAD message back as a multicast rather than as multiple unicasts " +
43
+ "(default is false)" )
44
+ protected boolean use_mcast_rsps =false ;
41
45
42
46
@ LocalAddress
43
47
@ Property (description ="Interface for ICMP pings. Used if use_icmp is true " +
44
48
"The following special values are also recognized: GLOBAL, SITE_LOCAL, LINK_LOCAL and NON_LOOPBACK" ,
45
49
systemProperty ={Global .BIND_ADDR })
46
- private InetAddress bind_addr ; // interface for ICMP pings
50
+ protected InetAddress bind_addr ; // interface for ICMP pings
47
51
48
52
@ Property (name ="bind_interface" , converter =PropertyConverters .BindInterface .class ,
49
53
description ="The interface (NIC) which should be used by this transport" , dependsUpon ="bind_addr" )
50
- protected String bind_interface_str =null ;
54
+ protected String bind_interface_str =null ;
51
55
52
56
/* --------------------------------------------- Fields ------------------------------------------------ */
53
57
@@ -115,10 +119,10 @@ public Object up(Event evt) {
115
119
}
116
120
else {
117
121
Message rsp ;
122
+ Address target =use_mcast_rsps ? null : hdr .from ;
118
123
for (int i =0 ; i < num_msgs ; i ++) {
119
- rsp =new Message (hdr .from , null , null );
120
- rsp .setFlag (Message .OOB );
121
- rsp .putHeader (this .id , new VerifyHeader (VerifyHeader .I_AM_NOT_DEAD , local_addr ));
124
+ rsp =new Message (target ).setFlag (Message .OOB )
125
+ .putHeader (this .id , new VerifyHeader (VerifyHeader .I_AM_NOT_DEAD , local_addr ));
122
126
down_prot .down (new Event (Event .MSG , rsp ));
123
127
}
124
128
}
@@ -271,7 +275,7 @@ public void unsuspect(Address mbr) {
271
275
}
272
276
273
277
274
- private synchronized void startTimer () {
278
+ protected synchronized void startTimer () {
275
279
if (timer == null || !timer .isAlive ()) {
276
280
timer =getThreadFactory ().newThread (this ,"VERIFY_SUSPECT.TimerThread" );
277
281
timer .setDaemon (true );
0 commit comments