[fpc-pascal] lNet getting the local IP
Brian Winfrey
bpwinfrey at gmail.com
Thu Oct 7 19:48:54 CEST 2010
>>
>> I didn't try it, but I see that it tries to connect to google's dns serve=
>r,
>> so it'd fail miserably if the computer has no internet access.
>>
>> Bye
>> --
>> Luca
>>
>
>I tested, without web access does not work. :o
A hard coded address will of course fail if it cannot be reached.
The code was an example, you should use it as such. I substituted my
router's ip for google's and it works.;)
Choose a different address that would not fail in a specific
situation.
As another example, one could read their /etc/resolve file to get
the dns server that is assigned.
Brian Winfrey
More information about the fpc-pascal
mailing list