I did just look through the DNS API and I couldn't see any support for asynchronous calls or setting a timeout.
I would start thread and call it from the thread. Then you can implement your own timeout by using WaitForSingleObject on the thread handle (from the calling thread).
Can you provide some sample code please how timeout can be implemented as after a particular period i have to kill the thread assuming that my DNS query failed.
I can't use terminate thread as it may induce resource leakage. And as call to api is blocking, how can i use WaitForSingleObject, please elaborate a bit.
Hmm... There is a small design error in the attached code in my previous post. I don't know if this error will show up (it never did for me), but the correction is to let the thread release parameters upon timeout. This is of course a bit tricky, becuase the thead must then know about the timeout (that it happened).
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.