Win7下为什么RAW Socket不能捕获发给自己的包
展开全部
win7的要不要初始化啊?我是XP.
WSADATA wsa;
WORD wVersionRequested;
wVersionRequested = MAKEWORD( 2, 0 );
if (WSAStartup(wVersionRequested , &wsa)!=0)
{printf("Winsock Initialization failed.\n"); exit(0);
};
初始化以后再 创建
if ((m_socket=socket(。。。,。。。。,。。。))==INVALID_SOCKET){ printf("Can not create socket.\n"); exit(0);
}
我用的头文件是 #include <afxsock.h>
WSADATA wsa;
WORD wVersionRequested;
wVersionRequested = MAKEWORD( 2, 0 );
if (WSAStartup(wVersionRequested , &wsa)!=0)
{printf("Winsock Initialization failed.\n"); exit(0);
};
初始化以后再 创建
if ((m_socket=socket(。。。,。。。。,。。。))==INVALID_SOCKET){ printf("Can not create socket.\n"); exit(0);
}
我用的头文件是 #include <afxsock.h>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询