[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] join group problem
Hi, all, I meet problem in dealing with SRM multicast. The group is very
dynamic, a same member may join and leave many times.
while in SRM , to my understanding, a member can decide if it needs to
request for old message when:
1: it receives data message.(in method recv_data(...))
from the message id it can know whether or not it needs to request .
2: it receives session message, (in method recv_sess(...))
This will bring a problem if a member join later than others , it will
automatically request for all the old message(id 0,1,....),how , we do not
want this happen, in fact, in some cases, it should not get any older
data.
To prevent this happen, I use:
1: every srmagent has a flag, so that when an agent just joins a group,it
will not send any session message, after it receives the first session
message from other member, it updates its information about all senders.
2: when an agent get the first data message from others, it will pretend
it has received all earlier data, in
recv_data(int sender, int msgid,..)
{
...
for(int i=msgid; i>=0; i--)
{
sp->setReceived(i);
}
}
while using these two methods, in most cases, it works, a new joiner will
not ask for old messages, however, sometimes , occasionally, some agents
will still ask for old data, I wonder if this is right way to do, or I
need to change some places else.
thank you
Sencun