TIdIPMCastServer TimeToLive bug ?

Giganews Newsgroups
Subject: TIdIPMCastServer TimeToLive bug ?
Posted by:  Steve Howe (howeste…@gmail.com)
Date: Wed, 02 Jan 2008

(I'm resending this since it appears not to have reached the server)

Hello all,

I've had a problem with TIdIPMCastServer.ApplytimeToLive()'s method; it
seems to be setting the TimeToLive value only at design time on purpose (I
wonder why).

To fix it, I've changed from (beware of the word wrap):

procedure TIdIPMCastServer.ApplyTimeToLive;
begin
  if FDsgnActive and (Assigned(FBinding) and FBinding.HandleAllocated) then
begin
    GStack.SetMulticastTTL(FBinding.Handle,FTimeToLive,FBinding.IPVersion);
  end;
end;

to:

procedure TIdIPMCastServer.ApplyTimeToLive;
begin
  if (Assigned(FBinding) and FBinding.HandleAllocated) then begin
    GStack.SetMulticastTTL(FBinding.Handle,FTimeToLive,FBinding.IPVersion);
  end;
end;

I've checked this and it works on the physical packet level.

Is there any reason to check for design time before setting the TTL value ?
Should I be setting the TimeToLeave property on another way or is this a bug
and this change applies as a fix?

Thanks !

--
Steve Howe

Replies