On 9/12/11 4:11 PM, Vladimir Panteleev wrote:
* Currently, reverse hostname lookup functions throw on failure. Such
lookups are not reliable and are expected to sometimes fail, so perhaps
a more appropriate behavior would be to return the requested IP address
unchanged, or a value indicating failure (null or false).

As discussed on IRC, throwing on reverse lookup failure seems very wrong to me, as it is certainly expected. In my opinion, the best solution would be to return null (empty string), but I am not certain if it should still throw if something went wrong during lookup (besides the IP address not being found).

I'll probably change the current std.socket.toHostAddrString() to behave like this, as the current behavior is inconsistent (when the getHostByAddr fallback is used), and I accidentally left it undocumented anyway.

David

Reply via email to