Mail Archives: djgpp/1998/06/24/23:23:49
On 24 Jun 98 at 19:23, Till Harbaum wrote:
> It seems that libsock somehow doesn't finger out the name of our dns
> server (which is properly configured in win95, winipcfg reports dns
> to be enabled and the correct ip of the dns server) and instead
> gives a null pointer down to the wsock-lib which immediately
> crashes.
>
> Does anybody know, what's wrong with this??
It's not possible to determine the DNS server's IP through the wsock
VxD (which is how libsocket works). To get that information you have
to dig around in the registry, which means you need a library of
registry reading routines, just to read a DNS server. On top of
that, the DNS server's IP is in different places for different
connection types; there may be more than one, only some of which will
work (again for different connection types); in particular, for a
dial up RAS connection retreiving the IP is not trivial. I don't
know for sure whether or not Indrek Mandre implemented this, but I've
never done it in any of my Winsock libraries ;).
If you read the docs for libsocket you'll probably find this
restriction mentioned somewhere. In practice it doesn't matter if
the DNS server you give isn't local, though you should encourage
users of the software to set it to a local one. winipcfg is of
course a good way to find one.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -