使用SIO_RCVALL的问题

liagl 2005-06-13 09:06:27
最近在学习使用Winsock写程序,我的机器是Windows2000 server,发现每次调用WSAIoctl设置SIO_RCVALL时都返回SOCKET_ERROR,WSAGetLastError返回10022,我调用的代码是
WSAIoctl(sock, SIO_RCVALL, &bRcvAll, sizeof(bRcvAll), &outbuf, sizeof(outbuf), &len, NULL, NULL)
有哪位知道是怎么回事?
...全文
145 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qrlvls 2005-06-14
  • 打赏
  • 举报
回复
SIO_RCVALL
Enables a socket to receive all IP packets on the network. The socket handle passed to the WSAIoctl function must be of AF_INET address family, SOCK_RAW socket type, and IPPROTO_IP protocol. The socket also must be bound to an explicit local interface, which means that you cannot bind to INADDR_ANY.
Once the socket is bound and the ioctl set, calls to the WSARecv or recv functions return IP datagrams passing through the given interface. Note that you must supply a sufficiently large buffer. Setting this ioctl requires Administrator privilege on the local computer. SIO_RCVALL is available in Windows 2000 and later versions of Windows.

必须绑定一个明确的 local interface,不能是 INADDR_ANY
liagl 2005-06-14
  • 打赏
  • 举报
回复
up

4,356

社区成员

发帖
与我相关
我的任务
社区描述
通信技术相关讨论
社区管理员
  • 网络通信
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧