Hey it's me again.
I just found out that Dns.EndGetHostEntry() throws a SocketException if the
host could not be found. Since it's called inside the async callback, it's left
uncaught and crashes the program.
This is undocumented behavior, only Dns.BeginGetHostEntry() is supposed to
throw SocketException according to the docs:
* http://msdn.microsoft.com/en-us/library/system.net.dns.begingethostentry.aspx
* http://msdn.microsoft.com/en-us/library/system.net.dns.endgethostentry.aspx
Anyway, here's a patch that correctly handles SocketError.HostNotFound inside
the callback. Other (hypothetical) exceptions are thrown (and are *uncatchable*
by caller because they happen inside the callback).
Original issue reported on code.google.com by elise...@gmail.com on 1 Oct 2011 at 3:46
Original issue reported on code.google.com by
elise...@gmail.com
on 1 Oct 2011 at 3:46Attachments: