Hi. GetLocalIPs in synamisc (code below) is returning 127.0.0.1 (or
127.0.1.1) on RaspBerry Pi and in Xubuntu (32b, in VBOX).
This means the function is unusable for cross-platform development. I found
this:
https://www.mail-archive.com/synalist-public@lists.sourceforge.net/msg03470/getlocalips.lpr
Referred to from:
http://forum.lazarus.freepascal.org/index.php/topic,23159.msg137844.html#msg137844
Is this a reliable solution? Do you have any plans on updating it?
Thanks.
/jm
function GetLocalIPs: string;
var
TcpSock: TTCPBlockSocket;
ipList: TStringList;
begin
Result := '';
ipList := TStringList.Create;
try
TcpSock := TTCPBlockSocket.create;
try
TcpSock.ResolveNameToIP(TcpSock.LocalName, ipList);
Result := ipList.CommaText;
finally
TcpSock.Free;
end;
finally
ipList.Free;
end;
end;
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public