Home All Groups Group Topic Archive Search About

Where is Dns.CancelAsync()?

Author
22 Sep 2006 6:15 PM
Leon_Amirreza
I know that Dns methods are static and CancelAsync() is implemented on
object instances but how can i clean up the resources if time out occurs?

I personally expected somthing like this:

private static void GetHostEntryCallback(IAsyncResult ar)
{
    Dns.EndGetHostEntry(ar);
...
    getHostEntryFinished.Set();
}

private void buttonResolve_Click(object sender, EventArgs e)
{
....
    if (getHostEntryFinished.WaitOne(30000, false))
    {
...
    }
    else
        Dns.CancelAsync();
....
}

AddThis Social Bookmark Button