使用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)
有哪位知道是怎么回事?
...全文
91 2 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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
  • 打赏
  • 举报
回复
发帖
通信技术
加入

4253

社区成员

通信技术相关讨论
社区管理员
  • 网络通信
申请成为版主
帖子事件
创建了帖子
2005-06-13 09:06
社区公告
暂无公告