IPv6(IdUDP) can not work.

Giganews Newsgroups
Subject: IPv6(IdUDP) can not work.
Posted by:  us…@domain.invalid
Date: Tue, 05 Feb 2008

IPv6(IdUDP) can not work.

---------------------------------
Lib/Core/

unit IdUDPBase

procedure TIdUDPBase.SendBuffer(const AHost: string; const APort: TIdPort;
  const AIPVersion: TIdIPVersion; const ABuffer: TIdBytes);
var
  LIP : String;
begin
  LIP := GStack.ResolveHost(AHost, AIPVersion);
-  Binding.SendTo(LIP, APort, ABuffer);
+  Binding.SendTo(LIP, APort, ABuffer, AIPVersion);
end;

---------------------------------

unit IdUDPClient

function TIdUDPClient.GetBinding: TIdSocketHandle;
begin
  if FBinding = nil then begin
    FBinding := TIdSocketHandle.Create(nil);
  end;
  with FBinding do
  begin
    if not HandleAllocated then begin
      {$IFDEF LINUX}
      AllocateSocket(LongInt(Id_SOCK_DGRAM));
      {$ELSE}
+      IPVersion := FIPVersion;
      AllocateSocket(Id_SOCK_DGRAM);
      {$ENDIF}
      IP := FBoundIP;
      Port := FBoundPort;
      ClientPortMin := FBoundPortMin;
      ClientPortMax := FBoundPortMax;
      IPVersion := FIPVersion;
      Bind;
      BroadcastEnabledChanged;
    end;
  end;
  Result := FBinding;
end;

Replies