IPv6下C++网络编程,getaddrinfo出错,求解决
我把代码简单描述一下
调试时候,总是有个Unhandled Exception : 0xC0000005 Aceess Violation.
其中我的 rm_hints 和 RemoteInfoText 是如下定义的。
在创建本地监听线程的时候,也用到了getaddrinfo(),没有错误,在解析远程地址时候,就出这个错误。头麻木了。。
求高手帮我讲解一下
memset(&rm_hints, 0, sizeof(rm_hints));
rm_hints.ai_family = AF_UNSPEC;
// rm_hints.ai_family = AF_INET6;
rm_hints.ai_socktype = SOCK_DGRAM;
rm_hints.ai_protocol = IPPROTO_UDP;
rm_hints.ai_flags = AI_CANONNAME;
// 解析远程IP地址
retVal = getaddrinfo(addr, TEXT_PORT, &rm_hints, &RemoteInfoText);
调试时候,总是有个Unhandled Exception : 0xC0000005 Aceess Violation.
其中我的 rm_hints 和 RemoteInfoText 是如下定义的。
struct addrinfo rm_hints;
struct addrinfo *RemoteInfoText = NULL, *RemoteInfoAudio = NULL;
在创建本地监听线程的时候,也用到了getaddrinfo(),没有错误,在解析远程地址时候,就出这个错误。头麻木了。。
求高手帮我讲解一下
...全文


网络编程
