11-14-2019, 05:15 PM
(This post was last modified: 12-06-2019, 01:49 PM by processeur_fou.)
Hello,
I use UDP to send a video stream to VLC, it works very well when I have a local network active (Wifi or Ethernet).
But if I have no Wifi and no Ethernet card activated, it works if I compile my source code using Delphi2010 ( using 127.0.0.1 IP address) but doesn’t work if I compile my source code using Delphi 10.
After searching, I discover that my procedure to find local IP can find 127.0.0.1 ( Nbr of local IP =1) using Delphi 2010 but find no local IP using Delphi 10 (Nbr of local IP = 0)
Why do I have this difference between Delphi2010 and Delphi_10 ? Have I miss something or compiler setup when I change my Delphi 2010 to Delphi 10?
Rem: I have tested also a second way to find the number of local IP but same result (0) using Delphi 10
Result is 0 using Delphi 10
Can someone tell me where I miss something?
Thank you.
I use UDP to send a video stream to VLC, it works very well when I have a local network active (Wifi or Ethernet).
But if I have no Wifi and no Ethernet card activated, it works if I compile my source code using Delphi2010 ( using 127.0.0.1 IP address) but doesn’t work if I compile my source code using Delphi 10.
After searching, I discover that my procedure to find local IP can find 127.0.0.1 ( Nbr of local IP =1) using Delphi 2010 but find no local IP using Delphi 10 (Nbr of local IP = 0)
Code:
TIdStack.IncUsage; LocalIPasked := '0.0.0.0';
try //**************************************************************
NbLocalIP := GStack.LocalAddresses.Count;
Memo1.Lines.Add(Format('nbr of local IP= %d ', [NbLocalIP]));
for i := 0 to NbLocalIP-1 do
begin
Memo1.Lines.Add(Format('IP n° %d = %s', [i + 1, GStack.LocalAddresses[i]]));
end;
finally
TIdStack.DecUsage;
end;
Why do I have this difference between Delphi2010 and Delphi_10 ? Have I miss something or compiler setup when I change my Delphi 2010 to Delphi 10?
Rem: I have tested also a second way to find the number of local IP but same result (0) using Delphi 10
Code:
...
LList := TIdStackLocalAddressList.Create;
try
GStack.GetLocalAddressList(LList);
Memo1.Lines.Add(Format('nbr of local IP found: %d ', [LList.Count]));
...
Result is 0 using Delphi 10
Can someone tell me where I miss something?
Thank you.