在异步的winsock地址解析? [英] Asynchronous address resolution in winsock?

查看:106
本文介绍了在异步的winsock地址解析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展望异步地址解析在winsock的似乎只有两种选择要么使用阻塞的gethostbyname 在一个单独的线程,或者使用 WSAAsyncGetHostByName 。后者是专为某些原因与窗口消息工作,而不是重叠操作和完成端口/程序。

Looking into asynchronous address resolution in winsock it seems that the only two options are either to use the blocking gethostbyname on a seperate thread, or use WSAAsyncGetHostByName. The latter is designed for some reason to work with window messages, instead of overlapped operations and completion ports/routines.

的gethostbyname 的任何版本的同异步重叠操作在一个类似的方式到的Winsock API的休息吗?

Is there any version of gethostbyname that works asynchronously with overlapped operations in a similiar manner to the rest of the winsock API?

推荐答案

不幸的是,没有present,虽然的 GetAddrInfoEx()通过所有的平常的路线(包括IOCP)具有对异步操作所有正确的事情占位符,所以我希望会有最终被......不幸的是,在这个时候,该文件说,所有这些必须设置为NULL,并标记为保留。 :(

Unfortunately there isn't at present, although GetAddrInfoEx() has placeholders for all the right things for async operation via all of the 'usual' routes (including IOCP) so I expect there will be eventually... Unfortunately, at this time, the docs say that all of these must be set to NULL and are marked as 'reserved'. :(

我只是写一个(有一段时间了)......这是不幸的 WSAAsyncGetHostByName 甚至不允许并发的名称解析,所以它的pretty无用为我想要什么基地;不过,话又说回来,因为它不处理IPv6也使得它pretty对我没用。我想我会从头开始;可能使用类似(啤酒软件)作为基础。

I'm just about to write one (have been for a while)... It's unfortunate that WSAAsyncGetHostByName doesn't even allow concurrent name resolution, so it's pretty useless as a base for what I want; but, then again, since it doesn't handle IPv6 that also makes it pretty useless to me. I expect I'll start from scratch; possibly using something like this (beerware) as a base.

这篇关于在异步的winsock地址解析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆